home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1993-09-10 | 143.5 KB | 5,086 lines
diff -cr --new-file andrew.orig/ams/libs/cui/andmchs.c andrew/ams/libs/cui/andmchs.c *** andrew.orig/ams/libs/cui/andmchs.c Fri Jan 24 03:39:12 1992 --- andrew/ams/libs/cui/andmchs.c Sat Sep 4 12:06:39 1993 *************** *** 38,44 **** #else /* AFS_ENV */ #define TOKENS_LEN 100 #endif /* AFS_ENV */ ! extern int (*CUI_GenericClientSignalHandler)(); extern char *sys_errlist[]; extern int sys_nerr; --- 38,46 ---- #else /* AFS_ENV */ #define TOKENS_LEN 100 #endif /* AFS_ENV */ ! #ifdef linux ! #include <bsd/signal.h> ! #endif extern int (*CUI_GenericClientSignalHandler)(); extern char *sys_errlist[]; extern int sys_nerr; *************** *** 408,416 **** --- 410,420 ---- case SIGQUIT: Text = "Quit"; break; + #ifdef SIGBUS case SIGBUS: Text = "Bus Error"; break; + #endif case SIGSEGV: Text = "Segmentation Violation"; break; *************** *** 459,465 **** --- 463,471 ---- signal(SIGINT, SnapifiedClientSignalHandler); signal(SIGQUIT, SnapifiedClientSignalHandler); + #ifdef SIGBUS signal(SIGBUS, SnapifiedClientSignalHandler); + #endif signal(SIGSEGV, SnapifiedClientSignalHandler); signal(SIGTERM, SnapifiedClientSignalHandler); #ifdef SIGTSTP diff -cr --new-file andrew.orig/ams/libs/ms/bldreply.c andrew/ams/libs/ms/bldreply.c *** andrew.orig/ams/libs/ms/bldreply.c Fri Jan 24 03:39:54 1992 --- andrew/ams/libs/ms/bldreply.c Sat Sep 4 12:06:39 1993 *************** *** 10,15 **** --- 10,18 ---- */ #include <ms.h> #include <hdrparse.h> + #ifndef NULL + #define NULL ((void*)0) + #endif #ifndef _IBMR2 extern char *malloc(); diff -cr --new-file andrew.orig/ams/libs/ms/bldwide.c andrew/ams/libs/ms/bldwide.c *** andrew.orig/ams/libs/ms/bldwide.c Fri Jan 24 03:39:55 1992 --- andrew/ams/libs/ms/bldwide.c Sat Sep 4 12:06:39 1993 *************** *** 10,16 **** */ #include <ms.h> #include <hdrparse.h> ! #ifndef _IBMR2 extern char *malloc(), *realloc(); #endif /* _IBMR2 */ --- 10,18 ---- */ #include <ms.h> #include <hdrparse.h> ! #ifndef NULL ! #define NULL ((void*)0) ! #endif #ifndef _IBMR2 extern char *malloc(), *realloc(); #endif /* _IBMR2 */ diff -cr --new-file andrew.orig/ams/libs/ms/fixsub.c andrew/ams/libs/ms/fixsub.c *** andrew.orig/ams/libs/ms/fixsub.c Fri Jan 24 03:40:11 1992 --- andrew/ams/libs/ms/fixsub.c Sat Sep 4 12:06:40 1993 *************** *** 9,14 **** --- 9,17 ---- $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/libs/ms/RCS/fixsub.c,v $ */ #include <ms.h> + #ifndef NULL + #define NULL ((void*)0) + #endif #ifndef _IBMR2 extern char *malloc(); diff -cr --new-file andrew.orig/ams/libs/ms/freemsg.c andrew/ams/libs/ms/freemsg.c *** andrew.orig/ams/libs/ms/freemsg.c Fri Jan 24 03:40:13 1992 --- andrew/ams/libs/ms/freemsg.c Sat Sep 4 12:06:40 1993 *************** *** 10,16 **** */ #include <ms.h> #include <hdrparse.h> ! /* 2 routines for backward compatibility */ FreeMessage(Msg, FreeSnapshot) --- 10,18 ---- */ #include <ms.h> #include <hdrparse.h> ! #ifndef NULL ! #define NULL ((void*)0) ! #endif /* 2 routines for backward compatibility */ FreeMessage(Msg, FreeSnapshot) diff -cr --new-file andrew.orig/ams/libs/ms/init.c andrew/ams/libs/ms/init.c *** andrew.orig/ams/libs/ms/init.c Fri Jan 24 03:40:30 1992 --- andrew/ams/libs/ms/init.c Sat Sep 4 12:06:40 1993 *************** *** 26,31 **** --- 26,34 ---- #ifdef hpux #include <signal.h> #endif /* hpux */ + #ifdef linux + #include <bsd/signal.h> + #endif extern char **environ; extern char *getprofile(), *index(), *rindex(), *StripWhiteEnds(); *************** *** 452,460 **** --- 455,465 ---- case SIGQUIT: Text = "Quit"; break; + #ifdef SIGBUS case SIGBUS: Text = "Bus Error"; break; + #endif case SIGSEGV: Text = "Segmentation Violation"; break; *************** *** 542,548 **** --- 547,555 ---- signal(SIGINT, DieYouHeathenSwine); signal(SIGQUIT, DieYouHeathenSwine); + #ifdef SIGBUS signal(SIGBUS, DieYouHeathenSwine); + #endif signal(SIGSEGV, DieYouHeathenSwine); signal(SIGTERM, DieYouHeathenSwine); #ifdef SIGTSTP diff -cr --new-file andrew.orig/ams/libs/ms/prsdate.y andrew/ams/libs/ms/prsdate.y *** andrew.orig/ams/libs/ms/prsdate.y Fri Jan 24 03:40:54 1992 --- andrew/ams/libs/ms/prsdate.y Sat Sep 4 12:06:40 1993 *************** *** 83,254 **** /* * Month and week day names (upper case only) and other words. */ ! struct stable strings[] = ! { ! { "JAN*UARY", MONTH, 0 }, /* months (0-11) */ ! { "FEB*RUARY", MONTH, 1 }, ! { "MAR*CH", MONTH, 2 }, ! { "APR*IL", MONTH, 3 }, ! { "MAY", MONTH, 4 }, ! { "JUN*E", MONTH, 5 }, ! { "JUL*Y", MONTH, 6 }, ! { "AUG*UST", MONTH, 7 }, ! { "SEP*TEMBER", MONTH, 8 }, ! { "OCT*OBER", MONTH, 9 }, ! { "NOV*EMBER", MONTH, 10 }, ! { "DEC*EMBER", MONTH, 11 }, ! { "SUN*DAY", WEEKDAY, 0 }, /* days of the week (0-6) */ ! { "MON*DAY", WEEKDAY, 1 }, ! { "TUE*SDAY", WEEKDAY, 2 }, ! { "WED*NESDAY", WEEKDAY, 3 }, ! { "THU*RSDAY", WEEKDAY, 4 }, ! { "FRI*DAY", WEEKDAY, 5 }, ! { "SAT*URDAY", WEEKDAY, 6 }, ! { "YESTERDAY", TODAY, -1 }, /* relative to today */ ! { "TODAY", TODAY, 0 }, ! { "TONIGHT", TONIGHT, 0 }, ! { "NOW", NOW, 0 }, ! { "AGO", AGO, 0 }, ! { "TOMORROW", TODAY, 1 }, ! { "NEXT", NEXT, 0 }, /* keywords */ ! { "THIS", THIS, 0 }, ! { "DAY*S", DAY, 0 }, ! { "WEEK*S", WEEK, 0 }, ! { "MONTH*S", WORD_MONTH, 0 }, ! { "YEAR*S", YEAR, 0 }, ! { "FORTNIGHT", FORTNIGHT, 0 }, /* two weeks (Australian) */ ! /* { "EVERY", EVERY, 0 }, */ ! { "FROM", FROM, 0 }, ! { "AFTER", AFTER, 0 }, ! { "BEFORE", BEFORE, 0 }, ! { "LAST", LAST, 0 }, ! { "THE", THE, 0 }, ! /* { "A", A, 0 }, */ ! { "AT", AT, 0 }, ! { "ON", ON, 0 }, ! { "IN", IN, 0 }, ! { "OF", OF, 0 }, ! /* { "AND", AND, 0 }, */ ! { "MORNING", TIMEKEY, 0 }, /* time keywords. Morning is 0:00 - 11:59 */ ! { "AFTERNOON", TIMEKEY, 12 }, /* Afternoon is 12:00 - 23:59 */ ! { "EVENING", TIMEKEY, 15 }, /* Evening is 15:00 - 02:59 */ ! { "NIGHT", TIMEKEY, 17 }, /* Night is 17:00 - 04:59 */ ! { "NOON", NOON, 12 }, /* time specifications */ ! { "MIDNIGHT", NOON, 24 }, ! { "ONE", NWORD, 1 }, /* numbers up to 19 */ ! { "TWO", NWORD, 2 }, ! { "THREE", NWORD, 3 }, ! { "FOUR", NWORD, 4 }, ! { "FIVE", NWORD, 5 }, ! { "SIX", NWORD, 6 }, ! { "SEVEN", NWORD, 7 }, ! { "EIGHT", NWORD, 8 }, ! { "NINE", NWORD, 9 }, ! { "TEN", NWORD, 10 }, ! { "ELEVEN", NWORD, 11 }, ! { "TWELVE", NWORD, 12 }, ! { "THIRTEEN", NWORD, 13 }, ! { "FOURTEEN", NWORD, 14 }, ! { "FIFTEEN", NWORD, 15 }, ! { "SIXTEEN", NWORD, 16 }, ! { "SEVENTEEN", NWORD, 17 }, ! { "EIGHTEEN", NWORD, 18 }, ! { "NINETEEN", NWORD, 19 }, ! { "FIRST", NTHWORD, 1 }, /* number up to 19th */ ! { "SECOND", NTHWORD, 2 }, ! { "THIRD", NTHWORD, 3 }, ! { "FOURTH", NTHWORD, 4 }, ! { "FIFTH", NTHWORD, 5 }, ! { "SIXTH", NTHWORD, 6 }, ! { "SEVENTH", NTHWORD, 7 }, ! { "EIGHT", NTHWORD, 8 }, ! { "NINTH", NTHWORD, 9 }, ! { "TENTH", NTHWORD, 10 }, ! { "ELEVENTH", NTHWORD, 11 }, ! { "TWELFTH", NTHWORD, 12 }, ! { "THIRTEENTH", NTHWORD, 13 }, ! { "FOURTEENTH", NTHWORD, 14 }, ! { "FIFTEENTH", NTHWORD, 15 }, ! { "SIXTEENTH", NTHWORD, 16 }, ! { "SEVENTEENTH", NTHWORD, 17 }, ! { "EIGHTEENTH", NTHWORD, 18 }, ! { "NINETEENTH", NTHWORD, 19 }, ! { "ST", ST, 0 }, /* for 1st */ ! { "ND", ND, 0 }, /* 2nd */ ! { "RD", RD, 0 }, /* 3rd */ ! { "TH", TH, 0 }, /* nth */ ! { "AM", AMPM, 0 }, /* time qualifiers */ ! { "A.M.", AMPM, 0 }, ! { "PM", AMPM, 12 }, ! { "P.M.", AMPM, 12 }, ! { "CHRISTMAS", CHRISTMAS, 1225 }, /* special dates */ ! { "NEW", NEW, 101 }, ! ! /* time zones */ ! { "UT", ZONE, 0 }, ! { "GMT", ZONE, 0 }, ! { "UTC", ZONE, 0 }, ! { "GST", ZONE, -180}, ! { "GDT", ZONE, -120}, ! { "NST", ZONE, -210}, ! { "AST", ZONE, -240}, ! { "ADT", ZONE, -180}, ! { "EST", ZONE, -300 }, ! { "EDT", ZONE, -240 }, ! { "CST", ZONE, -360 }, ! { "CDT", ZONE, -300 }, ! { "MST", ZONE, -420 }, ! { "MDT", ZONE, -360 }, ! { "PST", ZONE, -480 }, ! { "PDT", ZONE, -420 }, ! { "HST", ZONE, -600 }, ! { "HDT", ZONE, -540 }, ! { "AHST", ZONE, -600 }, ! { "AHDT", ZONE, -540 }, ! { "AEST", ZONE, 600 }, ! { "AESST", ZONE, 660 }, ! { "ACST", ZONE, 570 }, ! { "ACSST", ZONE, 630 }, ! { "AWST", ZONE, 480 }, ! { "AWSST", ZONE, 540 }, ! { "EET", ZONE, 120 }, ! { "MET", ZONE, 60 }, ! { "WET", ZONE, 0 }, ! { "BST", ZONE, 60 }, ! { "MEZ", ZONE, 60 }, ! { "MESZ", ZONE, 120 }, ! { "CET", ZONE, 60 }, ! { "CEST", ZONE, 120 }, ! /* military time */ ! { "Z", ZONE, 0 }, ! { "A", ZONE, -60 }, ! { "B", ZONE, -120 }, ! { "C", ZONE, -180 }, ! { "D", ZONE, -240 }, ! { "E", ZONE, -300 }, ! { "F", ZONE, -360 }, ! { "G", ZONE, -420 }, ! { "H", ZONE, -480 }, ! { "I", ZONE, -540 }, ! /* No 'J' -- it's not an accident */ ! { "K", ZONE, -600 }, ! { "L", ZONE, -660 }, ! { "M", ZONE, -720 }, ! { "N", ZONE, 60 }, ! { "O", ZONE, 120 }, ! { "P", ZONE, 180 }, ! { "Q", ZONE, 240 }, ! { "R", ZONE, 300 }, ! { "S", ZONE, 360 }, ! { "T", ZONE, 420 }, ! { "U", ZONE, 480 }, ! { "V", ZONE, 540 }, ! { "W", ZONE, 600 }, ! { "X", ZONE, 660 }, ! { "Y", ZONE, 720 }, ! ! { 0, 0, 0 } ! }; %} %% --- 83,89 ---- /* * Month and week day names (upper case only) and other words. */ ! struct stable strings[]; %} %% *************** *** 1490,1494 **** --- 1325,1496 ---- tm = gmtime(gmt); tm = localtime(gmt); } + + struct stable strings[] = + { + { "JAN*UARY", MONTH, 0 }, /* months (0-11) */ + { "FEB*RUARY", MONTH, 1 }, + { "MAR*CH", MONTH, 2 }, + { "APR*IL", MONTH, 3 }, + { "MAY", MONTH, 4 }, + { "JUN*E", MONTH, 5 }, + { "JUL*Y", MONTH, 6 }, + { "AUG*UST", MONTH, 7 }, + { "SEP*TEMBER", MONTH, 8 }, + { "OCT*OBER", MONTH, 9 }, + { "NOV*EMBER", MONTH, 10 }, + { "DEC*EMBER", MONTH, 11 }, + { "SUN*DAY", WEEKDAY, 0 }, /* days of the week (0-6) */ + { "MON*DAY", WEEKDAY, 1 }, + { "TUE*SDAY", WEEKDAY, 2 }, + { "WED*NESDAY", WEEKDAY, 3 }, + { "THU*RSDAY", WEEKDAY, 4 }, + { "FRI*DAY", WEEKDAY, 5 }, + { "SAT*URDAY", WEEKDAY, 6 }, + { "YESTERDAY", TODAY, -1 }, /* relative to today */ + { "TODAY", TODAY, 0 }, + { "TONIGHT", TONIGHT, 0 }, + { "NOW", NOW, 0 }, + { "AGO", AGO, 0 }, + { "TOMORROW", TODAY, 1 }, + { "NEXT", NEXT, 0 }, /* keywords */ + { "THIS", THIS, 0 }, + { "DAY*S", DAY, 0 }, + { "WEEK*S", WEEK, 0 }, + { "MONTH*S", WORD_MONTH, 0 }, + { "YEAR*S", YEAR, 0 }, + { "FORTNIGHT", FORTNIGHT, 0 }, /* two weeks (Australian) */ + /* { "EVERY", EVERY, 0 }, */ + { "FROM", FROM, 0 }, + { "AFTER", AFTER, 0 }, + { "BEFORE", BEFORE, 0 }, + { "LAST", LAST, 0 }, + { "THE", THE, 0 }, + /* { "A", A, 0 }, */ + { "AT", AT, 0 }, + { "ON", ON, 0 }, + { "IN", IN, 0 }, + { "OF", OF, 0 }, + /* { "AND", AND, 0 }, */ + { "MORNING", TIMEKEY, 0 }, /* time keywords. Morning is 0:00 - 11:59 */ + { "AFTERNOON", TIMEKEY, 12 }, /* Afternoon is 12:00 - 23:59 */ + { "EVENING", TIMEKEY, 15 }, /* Evening is 15:00 - 02:59 */ + { "NIGHT", TIMEKEY, 17 }, /* Night is 17:00 - 04:59 */ + { "NOON", NOON, 12 }, /* time specifications */ + { "MIDNIGHT", NOON, 24 }, + { "ONE", NWORD, 1 }, /* numbers up to 19 */ + { "TWO", NWORD, 2 }, + { "THREE", NWORD, 3 }, + { "FOUR", NWORD, 4 }, + { "FIVE", NWORD, 5 }, + { "SIX", NWORD, 6 }, + { "SEVEN", NWORD, 7 }, + { "EIGHT", NWORD, 8 }, + { "NINE", NWORD, 9 }, + { "TEN", NWORD, 10 }, + { "ELEVEN", NWORD, 11 }, + { "TWELVE", NWORD, 12 }, + { "THIRTEEN", NWORD, 13 }, + { "FOURTEEN", NWORD, 14 }, + { "FIFTEEN", NWORD, 15 }, + { "SIXTEEN", NWORD, 16 }, + { "SEVENTEEN", NWORD, 17 }, + { "EIGHTEEN", NWORD, 18 }, + { "NINETEEN", NWORD, 19 }, + { "FIRST", NTHWORD, 1 }, /* number up to 19th */ + { "SECOND", NTHWORD, 2 }, + { "THIRD", NTHWORD, 3 }, + { "FOURTH", NTHWORD, 4 }, + { "FIFTH", NTHWORD, 5 }, + { "SIXTH", NTHWORD, 6 }, + { "SEVENTH", NTHWORD, 7 }, + { "EIGHT", NTHWORD, 8 }, + { "NINTH", NTHWORD, 9 }, + { "TENTH", NTHWORD, 10 }, + { "ELEVENTH", NTHWORD, 11 }, + { "TWELFTH", NTHWORD, 12 }, + { "THIRTEENTH", NTHWORD, 13 }, + { "FOURTEENTH", NTHWORD, 14 }, + { "FIFTEENTH", NTHWORD, 15 }, + { "SIXTEENTH", NTHWORD, 16 }, + { "SEVENTEENTH", NTHWORD, 17 }, + { "EIGHTEENTH", NTHWORD, 18 }, + { "NINETEENTH", NTHWORD, 19 }, + { "ST", ST, 0 }, /* for 1st */ + { "ND", ND, 0 }, /* 2nd */ + { "RD", RD, 0 }, /* 3rd */ + { "TH", TH, 0 }, /* nth */ + { "AM", AMPM, 0 }, /* time qualifiers */ + { "A.M.", AMPM, 0 }, + { "PM", AMPM, 12 }, + { "P.M.", AMPM, 12 }, + { "CHRISTMAS", CHRISTMAS, 1225 }, /* special dates */ + { "NEW", NEW, 101 }, + + /* time zones */ + { "UT", ZONE, 0 }, + { "GMT", ZONE, 0 }, + { "UTC", ZONE, 0 }, + { "GST", ZONE, -180}, + { "GDT", ZONE, -120}, + { "NST", ZONE, -210}, + { "AST", ZONE, -240}, + { "ADT", ZONE, -180}, + { "EST", ZONE, -300 }, + { "EDT", ZONE, -240 }, + { "CST", ZONE, -360 }, + { "CDT", ZONE, -300 }, + { "MST", ZONE, -420 }, + { "MDT", ZONE, -360 }, + { "PST", ZONE, -480 }, + { "PDT", ZONE, -420 }, + { "HST", ZONE, -600 }, + { "HDT", ZONE, -540 }, + { "AHST", ZONE, -600 }, + { "AHDT", ZONE, -540 }, + { "AEST", ZONE, 600 }, + { "AESST", ZONE, 660 }, + { "ACST", ZONE, 570 }, + { "ACSST", ZONE, 630 }, + { "AWST", ZONE, 480 }, + { "AWSST", ZONE, 540 }, + { "EET", ZONE, 120 }, + { "MET", ZONE, 60 }, + { "WET", ZONE, 0 }, + { "BST", ZONE, 60 }, + { "MEZ", ZONE, 60 }, + { "MESZ", ZONE, 120 }, + { "CET", ZONE, 60 }, + { "CEST", ZONE, 120 }, + /* military time */ + { "Z", ZONE, 0 }, + { "A", ZONE, -60 }, + { "B", ZONE, -120 }, + { "C", ZONE, -180 }, + { "D", ZONE, -240 }, + { "E", ZONE, -300 }, + { "F", ZONE, -360 }, + { "G", ZONE, -420 }, + { "H", ZONE, -480 }, + { "I", ZONE, -540 }, + /* No 'J' -- it's not an accident */ + { "K", ZONE, -600 }, + { "L", ZONE, -660 }, + { "M", ZONE, -720 }, + { "N", ZONE, 60 }, + { "O", ZONE, 120 }, + { "P", ZONE, 180 }, + { "Q", ZONE, 240 }, + { "R", ZONE, 300 }, + { "S", ZONE, 360 }, + { "T", ZONE, 420 }, + { "U", ZONE, 480 }, + { "V", ZONE, 540 }, + { "W", ZONE, 600 }, + { "X", ZONE, 660 }, + { "Y", ZONE, 720 }, + + { 0, 0, 0 } + }; #endif NOTDEF diff -cr --new-file andrew.orig/ams/libs/ms/substr.c andrew/ams/libs/ms/substr.c *** andrew.orig/ams/libs/ms/substr.c Fri Jan 24 03:41:20 1992 --- andrew/ams/libs/ms/substr.c Sat Sep 4 12:06:41 1993 *************** *** 9,15 **** $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/libs/ms/RCS/substr.c,v $ */ #include <ms.h> ! char * FindSubString (sub, full) char *sub, --- 9,17 ---- $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/libs/ms/RCS/substr.c,v $ */ #include <ms.h> ! #ifndef NULL ! #define NULL ((void*)0) ! #endif char * FindSubString (sub, full) char *sub, diff -cr --new-file andrew.orig/atk/apps/runapp.c andrew/atk/apps/runapp.c *** andrew.orig/atk/apps/runapp.c Fri Jan 24 03:47:33 1992 --- andrew/atk/apps/runapp.c Thu Sep 9 14:03:21 1993 *************** *** 20,27 **** #include <im.ih> #include <app.ih> - extern int errno; #ifndef RUNAPP --- 20,29 ---- #include <im.ih> #include <app.ih> + #ifdef linux + #include <math.h> + #endif extern int errno; #ifndef RUNAPP *************** *** 36,41 **** --- 38,49 ---- fprintf(stderr,"usage:\t%s [-npdD] {-l classname} appclass args...\n",RUNAPP); exit(-1); } + #ifdef linux + static linux_dummy() + { + sin(0); + } + #endif static void initClass() { diff -cr --new-file andrew.orig/atk/basics/common/bind.ch andrew/atk/basics/common/bind.ch *** andrew.orig/atk/basics/common/bind.ch Fri Jan 24 03:49:27 1992 --- andrew/atk/basics/common/bind.ch Thu Sep 9 13:18:31 1993 *************** *** 12,18 **** struct bind_Description { char *procName; ! char *keyVector; long keyRock; char *menuEntry; long menuRock; --- 12,18 ---- struct bind_Description { char *procName; ! unsigned char *keyVector; long keyRock; char *menuEntry; long menuRock; diff -cr --new-file andrew.orig/atk/basics/common/keymap.c andrew/atk/basics/common/keymap.c *** andrew.orig/atk/basics/common/keymap.c Fri Jan 24 03:50:03 1992 --- andrew/atk/basics/common/keymap.c Thu Sep 9 13:18:31 1993 *************** *** 90,96 **** boolean keymap__BindToKey(self, keys, pe, rock) struct keymap *self; ! char *keys; struct proctable_Entry *pe; long rock; { --- 90,96 ---- boolean keymap__BindToKey(self, keys, pe, rock) struct keymap *self; ! unsigned char *keys; struct proctable_Entry *pe; long rock; { *************** *** 103,109 **** void keymap__RemoveBinding(self,keys) struct keymap *self; ! char *keys; { bindKey(self,keys,NULL,NULL,keymap_Empty); } --- 103,109 ---- void keymap__RemoveBinding(self,keys) struct keymap *self; ! unsigned char *keys; { bindKey(self,keys,NULL,NULL,keymap_Empty); } *************** *** 166,172 **** enum keymap_Types keymap__Lookup(self, key, object,rockP) struct keymap *self; ! char key; struct basicobject **object; long *rockP; { --- 166,172 ---- enum keymap_Types keymap__Lookup(self, key, object,rockP) struct keymap *self; ! unsigned char key; struct basicobject **object; long *rockP; { diff -cr --new-file andrew.orig/atk/basics/common/keymap.ch andrew/atk/basics/common/keymap.ch *** andrew.orig/atk/basics/common/keymap.ch Fri Jan 24 03:50:04 1992 --- andrew/atk/basics/common/keymap.ch Thu Sep 9 13:18:31 1993 *************** *** 29,35 **** struct keymap_sparsetable { int numValid; ! char keys[keymap_SPARSESIZE]; enum keymap_Types types[keymap_SPARSESIZE]; struct basicobject *objects[keymap_SPARSESIZE]; long rocks[keymap_SPARSESIZE]; --- 29,35 ---- struct keymap_sparsetable { int numValid; ! unsigned char keys[keymap_SPARSESIZE]; enum keymap_Types types[keymap_SPARSESIZE]; struct basicobject *objects[keymap_SPARSESIZE]; long rocks[keymap_SPARSESIZE]; *************** *** 43,53 **** class keymap { methods: ! BindToKey(char *keys, struct proctable_Entry *pe, long rock) returns boolean; ! RemoveBinding(char *keys); InsertObject(long slot, struct basicobject *object, long rock, enum keymap_Types type); /* Lookup stuffs an object in the char * and returns an int that describes its type. */ ! Lookup(char key, struct basicobject **object, long *rockP) returns enum keymap_Types; data: union { struct keymap_sparsetable *sparse; --- 43,53 ---- class keymap { methods: ! BindToKey(unsigned char *keys, struct proctable_Entry *pe, long rock) returns boolean; ! RemoveBinding(unsigned char *keys); InsertObject(long slot, struct basicobject *object, long rock, enum keymap_Types type); /* Lookup stuffs an object in the char * and returns an int that describes its type. */ ! Lookup(unsigned char key, struct basicobject **object, long *rockP) returns enum keymap_Types; data: union { struct keymap_sparsetable *sparse; diff -cr --new-file andrew.orig/atk/basics/common/profile.c andrew/atk/basics/common/profile.c *** andrew.orig/atk/basics/common/profile.c Fri Jan 24 03:50:40 1992 --- andrew/atk/basics/common/profile.c Sat Sep 4 13:31:47 1993 *************** *** 16,28 **** /* * AIX is SYSVish when it comes to profiling. */ ! #ifdef AIX #ifndef SYSV #define SYSV 1 #endif /* #ifndef SYSV */ #endif /* #ifdef AIX */ ! #if (!defined(AIX) && !defined(_IBMR2) && !defined(HP300_ENV) && !defined(M_UNIX) && !defined(SGI_4D_ENV)) #include <sys/gprof.h> #endif /* (!defined(AIX) && !defined(_IBMR2) && !defined(HP300_ENV)) */ --- 16,28 ---- /* * AIX is SYSVish when it comes to profiling. */ ! #if defined(AIX) || defined(linux) #ifndef SYSV #define SYSV 1 #endif /* #ifndef SYSV */ #endif /* #ifdef AIX */ ! #if (!defined(AIX) && !defined(_IBMR2) && !defined(HP300_ENV) && !defined(M_UNIX) && !defined(SGI_4D_ENV)) && !defined(linux) #include <sys/gprof.h> #endif /* (!defined(AIX) && !defined(_IBMR2) && !defined(HP300_ENV)) */ diff -cr --new-file andrew.orig/atk/basics/x/xim.c andrew/atk/basics/x/xim.c *** andrew.orig/atk/basics/x/xim.c Wed Feb 19 03:52:16 1992 --- andrew/atk/basics/x/xim.c Sat Sep 4 12:06:42 1993 *************** *** 68,73 **** --- 68,79 ---- #include <errprntf.h> + #if defined(linux) || defined(HAVE_STREAMBUF) + #define FILE_USED(f) ((f)->_egptr - (f)->_gptr) + #else + #define FILE_USED(f) ((f)->_cnt) + #endif + /* Note this constant also occurs in the cmenus package and in menubar.c */ #define MAXPANEPRIORITY 100 *************** *** 2993,2999 **** while (--nfs>=0) { f = globalFILEHandlers[nfs].file; if (f != NULL) { ! if (f->_cnt > 0) { ret = TRUE; (globalFILEHandlers[nfs].proc)(f, globalFILEHandlers[nfs].procdata); } --- 2999,3005 ---- while (--nfs>=0) { f = globalFILEHandlers[nfs].file; if (f != NULL) { ! if (FILE_USED(f) > 0) { ret = TRUE; (globalFILEHandlers[nfs].proc)(f, globalFILEHandlers[nfs].procdata); } diff -cr --new-file andrew.orig/atk/bush/bush.c andrew/atk/bush/bush.c *** andrew.orig/atk/bush/bush.c Fri Jan 24 03:51:12 1992 --- andrew/atk/bush/bush.c Sat Sep 4 12:06:42 1993 *************** *** 749,755 **** #endif /* SY_AIX12 && !hpux */ register int fd; ! #ifdef SGI_4D_ENV getpgrp(); #else setpgrp(0,pid = getpid()); --- 749,755 ---- #endif /* SY_AIX12 && !hpux */ register int fd; ! #if defined(SGI_4D_ENV) || defined(linux) getpgrp(); #else setpgrp(0,pid = getpid()); diff -cr --new-file andrew.orig/atk/console/lib/input.c andrew/atk/console/lib/input.c *** andrew.orig/atk/console/lib/input.c Fri Jan 24 03:53:25 1992 --- andrew/atk/console/lib/input.c Sat Sep 4 11:09:07 1993 *************** *** 38,44 **** #include <console.h> #include <convers.h> #include <andrewos.h> /* sys/types.h sys/time.h */ ! #ifdef M_UNIX #include <dirent.h> #define direct dirent #define namlen(d) (strlen((d)->d_name)) --- 38,44 ---- #include <console.h> #include <convers.h> #include <andrewos.h> /* sys/types.h sys/time.h */ ! #if defined(M_UNIX) || defined(linux) #include <dirent.h> #define direct dirent #define namlen(d) (strlen((d)->d_name)) diff -cr --new-file andrew.orig/atk/console/lib/mailmonf.c andrew/atk/console/lib/mailmonf.c *** andrew.orig/atk/console/lib/mailmonf.c Fri Jan 24 03:53:28 1992 --- andrew/atk/console/lib/mailmonf.c Sat Sep 4 11:18:47 1993 *************** *** 20,26 **** #include <conclass.ih> #include <console.h> #include <sys/param.h> ! #ifdef M_UNIX #include <dirent.h> #define direct dirent #define namlen(d) (strlen((d)->d_name)) --- 20,26 ---- #include <conclass.ih> #include <console.h> #include <sys/param.h> ! #if defined(M_UNIX) || defined(linux) #include <dirent.h> #define direct dirent #define namlen(d) (strlen((d)->d_name)) diff -cr --new-file andrew.orig/atk/console/lib/setup.c andrew/atk/console/lib/setup.c *** andrew.orig/atk/console/lib/setup.c Fri Jan 24 03:53:33 1992 --- andrew/atk/console/lib/setup.c Sat Sep 4 12:06:43 1993 *************** *** 42,48 **** #include <sys/wait.h> #endif /* hp9000s300 */ #include <sitevars.h> ! #ifdef hpux #define killpg(id,sig) kill(-(id),sig) #endif /* hpux */ --- 42,50 ---- #include <sys/wait.h> #endif /* hp9000s300 */ #include <sitevars.h> ! #ifdef linux ! #include <bsd/signal.h> ! #endif #ifdef hpux #define killpg(id,sig) kill(-(id),sig) #endif /* hpux */ *************** *** 1416,1422 **** --- 1418,1428 ---- if (*newchild == -1) newchild[1] = -1; if ((*newchild = osi_vfork()) == 0) { + #if defined(linux) + setpgrp(); + #else setpgrp(0, getpid()); + #endif execl(_SITE_BIN_SH, "sh", "-c", TokenBuf, 0); _exit(0); } *************** *** 1969,1974 **** --- 1975,1983 ---- #if defined(hpux) || defined(M_UNIX) setpgrp(); /* breaks process group affiliation of controlling terminal */ #else /* hpux */ + #ifdef POSIX_ENV + setsid(); + #else /* posix */ /* Grubby fix for wm startup bug, courtesy of Bruce Lucas */ fd=open(_SITE_DEV_TTY, 2); if (fd>=0) { *************** *** 1975,1980 **** --- 1984,1990 ---- ioctl(fd, TIOCNOTTY, 0); close(fd); } + #endif /* posix */ #endif /* hpux */ #ifdef SIGXFSZ signal(SIGXFSZ, ToggleDebugging); diff -cr --new-file andrew.orig/atk/console/lib/vmmon.c andrew/atk/console/lib/vmmon.c *** andrew.orig/atk/console/lib/vmmon.c Fri Jan 24 03:53:41 1992 --- andrew/atk/console/lib/vmmon.c Sat Sep 4 12:06:43 1993 *************** *** 73,79 **** --- 73,83 ---- if ((*newchild = osi_vfork()) == 0) { /* since the pid is 0, then all calls apply to this process group */ theGetstatsPid = getpid(); + #ifdef linux + setpgrp(); + #else setpgrp(0, theGetstatsPid); + #endif /* 1 == stdout */ if (dup2 (pfds[1], 1) == -1){ perror("console: dup2 failed while forking getstats\n"); *************** *** 83,89 **** perror("console:<child> close of pfds[0] failed\n"); } if (close (pfds[1]) == -1){ ! perror(self, "console: close of pfds[1] failed\n"); } myargv[0] = "getstats"; sprintf(userid, "%d", getuid()); --- 87,93 ---- perror("console:<child> close of pfds[0] failed\n"); } if (close (pfds[1]) == -1){ ! perror("console: close of pfds[1] failed\n"); } myargv[0] = "getstats"; sprintf(userid, "%d", getuid()); diff -cr --new-file andrew.orig/atk/console/stats/i386_linux/Imakefile andrew/atk/console/stats/i386_linux/Imakefile *** andrew.orig/atk/console/stats/i386_linux/Imakefile --- andrew/atk/console/stats/i386_linux/Imakefile Mon Sep 6 19:30:41 1993 *************** *** 0 **** --- 1,22 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1991 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + LOCALINCLUDES = -I../../lib + + DependTarget() + NormalObjectRule() + + LibraryTarget(libgs.a, getstats.o) + + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1991 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + LOCALINCLUDES = -I../../lib + + DependTarget() + NormalObjectRule() + + LibraryTarget(libgs.a, getstats.o) + diff -cr --new-file andrew.orig/atk/console/stats/i386_linux/getstats.c andrew/atk/console/stats/i386_linux/getstats.c *** andrew.orig/atk/console/stats/i386_linux/getstats.c --- andrew/atk/console/stats/i386_linux/getstats.c Mon Sep 6 19:30:41 1993 *************** *** 0 **** --- 1,156 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1991 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + static char *getstats_rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v 1.2 1991/09/12 16:08:39 bobg Exp $"; + + /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v 1.2 1991/09/12 16:08:39 bobg Exp $ */ + /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v $ */ + + #ifndef lint + static char *getstats_c_id = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v 1.2 1991/09/12 16:08:39 bobg Exp $"; + #endif /* lint */ + + /* ********************************************************************** + * **************** + * STUB LIBRARY FILE---NOT YET IMPLEMENTED FOR THIS SYSTEM + * THIS CODE SHOULD BE REPLACED BY AN IMPLEMENTATION OF + * THE RELEVANT ROUTINES FOR YOUR MACHINE TYPE. + * Please contribute your implementations to info-andrew-bugs@andrew.cmu.edu. + * You may use any of the other ../<several>/getstats.c files as templates. + * **************** + * + * This code is designed to read what might be priveledged (setuid) + * information regarding both Disk Statistics (% full) and a host of + * stats from /dev/kmem (including but not limited to, CPU, I/O, and VM) + * + * When retriving the data - this program will print out to stdout + * a string in the form of either "%d:%d\n" or "%d:%d:%s\n" + * The latter case is for passing the name of where a disk is mounted + * back to the parent program. + * + * The parent program (Console, or any other program which wishes to get + * at this information) is responsible for setting up a pipe, binding the + * child's (this program) stdout to one end of a pipe, and parsing the + * strings which are passed back. + * + * The basic string format is an ID (int), a colon, a value (int), and + * optionally another colon followed by a string. The ID is coded from + * the included file "getstats.h" - ID values 50 and over represent + * ERRORS as documented in the above mentioned inclued file. When an + * ERROR or the optional string is passed, the value (second parameter) + * can be safely ignored, and is usually set to 0. + * + * The arguments to be passed to this program are the effective UID from + * the parent program, a polling frequency (# of seconds) for checking + * /dev/kmem (usually between 1 and 5, must be > 0), and a polling + * frequency for checking how full the local disks are (generally higher + * than the value for /dev/kmem, but could vary greatly). Thus the call + * is: + * + * execvp("getstats", argv) + * + * with argv as: + * + * argv[0]="getstats"; + * argv[1]=~ ("%d", UID); + * argv[2]=~ ("%d", kmempollfrequency); + * argv[3]=~ ("%d", diskpollfrequency); + * argv[4]=NULL; + * + ********************************************************************** */ + #include <sitevars.h> + + #include <system.h> + + GetGVMStats(UsersID) + int UsersID; + { + } + + InitGVMStats() + { + } + + GetDiskStats(Init) + int Init; + { + } + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1991 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + static char *getstats_rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v 1.2 1991/09/12 16:08:39 bobg Exp $"; + + /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v 1.2 1991/09/12 16:08:39 bobg Exp $ */ + /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v $ */ + + #ifndef lint + static char *getstats_c_id = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v 1.2 1991/09/12 16:08:39 bobg Exp $"; + #endif /* lint */ + + /* ********************************************************************** + * **************** + * STUB LIBRARY FILE---NOT YET IMPLEMENTED FOR THIS SYSTEM + * THIS CODE SHOULD BE REPLACED BY AN IMPLEMENTATION OF + * THE RELEVANT ROUTINES FOR YOUR MACHINE TYPE. + * Please contribute your implementations to info-andrew-bugs@andrew.cmu.edu. + * You may use any of the other ../<several>/getstats.c files as templates. + * **************** + * + * This code is designed to read what might be priveledged (setuid) + * information regarding both Disk Statistics (% full) and a host of + * stats from /dev/kmem (including but not limited to, CPU, I/O, and VM) + * + * When retriving the data - this program will print out to stdout + * a string in the form of either "%d:%d\n" or "%d:%d:%s\n" + * The latter case is for passing the name of where a disk is mounted + * back to the parent program. + * + * The parent program (Console, or any other program which wishes to get + * at this information) is responsible for setting up a pipe, binding the + * child's (this program) stdout to one end of a pipe, and parsing the + * strings which are passed back. + * + * The basic string format is an ID (int), a colon, a value (int), and + * optionally another colon followed by a string. The ID is coded from + * the included file "getstats.h" - ID values 50 and over represent + * ERRORS as documented in the above mentioned inclued file. When an + * ERROR or the optional string is passed, the value (second parameter) + * can be safely ignored, and is usually set to 0. + * + * The arguments to be passed to this program are the effective UID from + * the parent program, a polling frequency (# of seconds) for checking + * /dev/kmem (usually between 1 and 5, must be > 0), and a polling + * frequency for checking how full the local disks are (generally higher + * than the value for /dev/kmem, but could vary greatly). Thus the call + * is: + * + * execvp("getstats", argv) + * + * with argv as: + * + * argv[0]="getstats"; + * argv[1]=~ ("%d", UID); + * argv[2]=~ ("%d", kmempollfrequency); + * argv[3]=~ ("%d", diskpollfrequency); + * argv[4]=NULL; + * + ********************************************************************** */ + #include <sitevars.h> + + #include <system.h> + + GetGVMStats(UsersID) + int UsersID; + { + } + + InitGVMStats() + { + } + + GetDiskStats(Init) + int Init; + { + } diff -cr --new-file andrew.orig/atk/controllers/helpcon.c andrew/atk/controllers/helpcon.c *** andrew.orig/atk/controllers/helpcon.c Fri Jan 24 03:52:33 1992 --- andrew/atk/controllers/helpcon.c Sat Sep 4 11:05:11 1993 *************** *** 15,21 **** #include "proctbl.ih" #include "view.ih" #include "arbiterv.ih" ! #ifdef M_UNIX #include <dirent.h> #define direct dirent #else --- 15,21 ---- #include "proctbl.ih" #include "view.ih" #include "arbiterv.ih" ! #if defined(M_UNIX) || defined(linux) #include <dirent.h> #define direct dirent #else diff -cr --new-file andrew.orig/atk/extensions/compile.c andrew/atk/extensions/compile.c *** andrew.orig/atk/extensions/compile.c Fri Jan 24 03:59:47 1992 --- andrew/atk/extensions/compile.c Sat Sep 4 12:06:43 1993 *************** *** 156,162 **** for (fd = 3; fd < numfds; fd++) close(fd); ! #if defined(hpux) || defined(SGI_4D_ENV) setpgrp(); #else /* hpux */ setpgrp(0, getpid()); --- 156,162 ---- for (fd = 3; fd < numfds; fd++) close(fd); ! #if defined(hpux) || defined(SGI_4D_ENV) || defined(linux) setpgrp(); #else /* hpux */ setpgrp(0, getpid()); diff -cr --new-file andrew.orig/atk/extensions/ezdiff.c andrew/atk/extensions/ezdiff.c *** andrew.orig/atk/extensions/ezdiff.c Fri Jan 24 03:59:57 1992 --- andrew/atk/extensions/ezdiff.c Sat Sep 4 12:06:43 1993 *************** *** 29,34 **** --- 29,38 ---- #include <cursor.ih> #include <ezdiff.eh> + #ifdef linux + #include <sys/wait.h> + #endif + #define ObjectOf(V) (((struct view *)(V))->dataobject) #define USECURRENTMARK -32000l struct ezdiff *firstlink , *lastlink; *************** *** 208,218 **** _exit(4); } wait(&status); - #ifdef hpux - switch((((int)status >>8)&0377)){ #else /* hpux */ switch(status.w_T.w_Retcode){ #endif /* hpux */ case 0: /* No Differences */ message_DisplayString(NULL,0,"Files are identical"); --- 212,226 ---- _exit(4); } wait(&status); + #if defined(hpux) + switch((((int)status >>8)&0377)){ #else /* hpux */ + #ifdef linux + switch(WEXITSTATUS(status)){ + #else switch(status.w_T.w_Retcode){ + #endif #endif /* hpux */ case 0: /* No Differences */ message_DisplayString(NULL,0,"Files are identical"); diff -cr --new-file andrew.orig/atk/extensions/spell.c andrew/atk/extensions/spell.c *** andrew.orig/atk/extensions/spell.c Fri Jan 24 04:00:09 1992 --- andrew/atk/extensions/spell.c Sat Sep 4 12:06:44 1993 *************** *** 91,97 **** for (fd = 3; fd < numfds; fd++) close(fd); ! #if defined(SGI_4D_ENV) setpgrp(); #else setpgrp(0, getpid()); --- 91,97 ---- for (fd = 3; fd < numfds; fd++) close(fd); ! #if defined(SGI_4D_ENV) || defined(linux) setpgrp(); #else setpgrp(0, getpid()); diff -cr --new-file andrew.orig/atk/fad/fadv.c andrew/atk/fad/fadv.c *** andrew.orig/atk/fad/fadv.c Fri Jan 24 04:00:34 1992 --- andrew/atk/fad/fadv.c Sat Sep 4 12:06:44 1993 *************** *** 10,15 **** --- 10,21 ---- static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/fad/RCS/fadv.c,v 2.14 1991/09/12 16:21:00 bobg Exp $"; #endif /* lint */ + #if defined(linux) || defined(HAVE_STREAMBUF) + #define FILE_USED(f) ((f)->_egptr - (f)->_gptr) + #else + #define FILE_USED(f) ((f)->_cnt) + #endif + #include <andrewos.h> /* sys/time.h sys/types.h */ #include <sys/stat.h> #include <class.h> *************** *** 1144,1150 **** while(( c = getc(f))!= EOF){ if(c == NULL) break; fad_setpoint(cpic, fad_iconnum(cpic,cpic->cfname), c,NEW,self->f); ! if(f->_cnt == 0) break; } if(c == EOF){ if(cpic->iconpointend == cpic->iconpoints) --- 1150,1156 ---- while(( c = getc(f))!= EOF){ if(c == NULL) break; fad_setpoint(cpic, fad_iconnum(cpic,cpic->cfname), c,NEW,self->f); ! if(FILE_USED(f) == 0) break; } if(c == EOF){ if(cpic->iconpointend == cpic->iconpoints) diff -cr --new-file andrew.orig/atk/frame/framecmd.c andrew/atk/frame/framecmd.c *** andrew.orig/atk/frame/framecmd.c Fri Jan 24 04:00:43 1992 --- andrew/atk/frame/framecmd.c Sat Sep 4 12:06:44 1993 *************** *** 86,92 **** --- 86,94 ---- return FALSE; /* too small an integer to be a pointer (in ATK) */ /* now be sure we can fetch from the location */ + #ifdef SIGBUS oldBus = signal(SIGBUS, SigHandler); + #endif oldSeg = signal(SIGSEGV, SigHandler); if (setjmp(trap) != 0) /* return here from longjmp */ *************** *** 93,100 **** c = '\1'; /* not a legal string */ else /* normal setjmp return location */ ! c = *arg; /* this could fail if arg were not a pointer */ signal(SIGBUS, oldBus); signal(SIGSEGV, oldSeg); /* return value depending on whether it points to an ASCII printable character */ --- 95,105 ---- c = '\1'; /* not a legal string */ else /* normal setjmp return location */ ! c = *arg; /* this could fail if arg were */ ! /* not a pointer */ ! #ifdef SIGBUS signal(SIGBUS, oldBus); + #endif signal(SIGSEGV, oldSeg); /* return value depending on whether it points to an ASCII printable character */ diff -cr --new-file andrew.orig/atk/help/src/helpdb.c andrew/atk/help/src/helpdb.c *** andrew.orig/atk/help/src/helpdb.c Fri Jan 24 04:01:19 1992 --- andrew/atk/help/src/helpdb.c Sat Sep 4 11:17:11 1993 *************** *** 37,43 **** #include <stdio.h> #include <errno.h> #include <ctype.h> ! #ifdef M_UNIX #include <dirent.h> #define direct dirent #define namlen(d) (strlen((d)->d_name)) --- 37,43 ---- #include <stdio.h> #include <errno.h> #include <ctype.h> ! #if defined(M_UNIX) || defined(linux) #include <dirent.h> #define direct dirent #define namlen(d) (strlen((d)->d_name)) diff -cr --new-file andrew.orig/atk/layout/boxview.c andrew/atk/layout/boxview.c *** andrew.orig/atk/layout/boxview.c Fri Jan 24 04:01:54 1992 --- andrew/atk/layout/boxview.c Sun Sep 5 10:56:55 1993 *************** *** 16,21 **** --- 16,24 ---- #ifndef _IBMR2 extern char *malloc(); #endif /* _IBMR2 */ + #ifdef linux + #define NDEBUG + #endif #include <class.h> #include <assert.h> diff -cr --new-file andrew.orig/atk/layout/fillerv.c andrew/atk/layout/fillerv.c *** andrew.orig/atk/layout/fillerv.c Fri Jan 24 04:01:55 1992 --- andrew/atk/layout/fillerv.c Sun Sep 5 10:53:49 1993 *************** *** 21,26 **** --- 21,30 ---- extern char *realloc(); #endif /* _IBMR2 */ + #ifdef linux + #define NDEBUG + #endif + #include <class.h> #include <assert.h> diff -cr --new-file andrew.orig/atk/ness/objects/call.c andrew/atk/ness/objects/call.c *** andrew.orig/atk/ness/objects/call.c Fri Mar 13 04:13:58 1992 --- andrew/atk/ness/objects/call.c Sun Sep 5 11:10:36 1993 *************** *** 18,24 **** --- 18,31 ---- #include <ctype.h> #include <sys/param.h> #include <sys/types.h> + #if defined(M_UNIX) || defined(linux) + #include <dirent.h> + #define direct dirent + #define namlen(d) (strlen((d)->d_name)) + #else #include <sys/dir.h> + #define namlen(d) ((d)->d_namlen) + #endif #include <filetype.ih> #include <environ.ih> *************** *** 1486,1502 **** struct nesssym *s; boolean new; ! t = (unsigned char *)(entry->d_name + entry->d_namlen); if (*(t-2) != '.' || *(t-1) != 'n') /* skip all files other than *.n */ continue; ! fname = (unsigned char *)malloc(entry->d_namlen+1); ! symname = (unsigned char *)malloc(entry->d_namlen+1); ! strncpy(fname, entry->d_name, entry->d_namlen); ! fname[entry->d_namlen] = '\0'; /* build symbol name */ strcpy(symname, fname); ! symname[entry->d_namlen-2] = '\0'; /* remove .n */ for (t=symname; *t; t++) /* smash case */ if (isupper(*t)) *t = tolower(*t); s = nesssym_NLocate(symname, proto, LibScope, &new); --- 1493,1509 ---- struct nesssym *s; boolean new; ! t = (unsigned char *)(entry->d_name + namlen(entry)); if (*(t-2) != '.' || *(t-1) != 'n') /* skip all files other than *.n */ continue; ! fname = (unsigned char *)malloc(namlen(entry)+1); ! symname = (unsigned char *)malloc(namlen(entry)+1); ! strncpy(fname, entry->d_name, namlen(entry)); ! fname[namlen(entry)] = '\0'; /* build symbol name */ strcpy(symname, fname); ! symname[namlen(entry)-2] = '\0'; /* remove .n */ for (t=symname; *t; t++) /* smash case */ if (isupper(*t)) *t = tolower(*t); s = nesssym_NLocate(symname, proto, LibScope, &new); *************** *** 1646,1652 **** under = (unsigned char *)index(fun, '_'); if (under == NULL) return NotRead; /* not valid library function name */ ! nmlen = MIN(MAXNAMLEN, under - fun); strncpy(fname, fun, nmlen); fname[nmlen] = '\0'; libsym = nesssym_NFind(fname, LibScope); --- 1653,1659 ---- under = (unsigned char *)index(fun, '_'); if (under == NULL) return NotRead; /* not valid library function name */ ! nmlen = (MAXNAMLEN > under - fun) ? ( under - fun ) : MAXNAMLEN; strncpy(fname, fun, nmlen); fname[nmlen] = '\0'; libsym = nesssym_NFind(fname, LibScope); diff -cr --new-file andrew.orig/atk/ness/objects/interp.c andrew/atk/ness/objects/interp.c *** andrew.orig/atk/ness/objects/interp.c Fri Mar 13 04:14:03 1992 --- andrew/atk/ness/objects/interp.c Sun Sep 5 10:59:44 1993 *************** *** 629,635 **** --- 629,637 ---- } /* restore error traps */ + #ifdef SIGBUS signal(SIGBUS, oldBus); + #endif signal(SIGSEGV, oldSeg); /* restore global variables */ *************** *** 655,661 **** --- 657,665 ---- /* when first called setjmp returns zero so execution initially continues here */ /* catch disasterous errors */ + #ifdef SIGBUS oldBus = (int (*)())signal(SIGBUS, SigHandler); + #endif oldSeg = (int (*)())signal(SIGSEGV, SigHandler); while (TRUE) { diff -cr --new-file andrew.orig/atk/ness/objects/real.c andrew/atk/ness/objects/real.c *** andrew.orig/atk/ness/objects/real.c Fri Jan 24 04:03:32 1992 --- andrew/atk/ness/objects/real.c Sun Sep 5 11:12:50 1993 *************** *** 101,106 **** --- 101,111 ---- case 'b': NSP->d.v = acosh(NSP->d.v); break; case 'd': NSP->d.v = asinh(NSP->d.v); break; case 'f': NSP->d.v = atanh(NSP->d.v); break; + #ifdef linux + #define log1p(x) (log(1.0 + (x))) + #define expm1(x) (exp((x)) - 1.0) + #define cbrt(x) (pow((x), 1.0/3.0)) + #endif case 'g': NSP->d.v = cbrt(NSP->d.v); break; case 'n': NSP->d.v = expm1(NSP->d.v); break; case 'w': NSP->d.v = log1p(NSP->d.v); break; diff -cr --new-file andrew.orig/atk/ness/type/err.c andrew/atk/ness/type/err.c *** andrew.orig/atk/ness/type/err.c Fri Jan 24 04:02:43 1992 --- andrew/atk/ness/type/err.c Sun Sep 5 10:58:25 1993 *************** *** 39,45 **** --- 39,47 ---- _err_LookAhead() { + #ifdef SIGBUS signal(SIGBUS, err_HandleSignal); + #endif signal(SIGSEGV, err_HandleSignal); } *************** *** 46,51 **** --- 48,55 ---- void err_MarkEnd() { + #ifdef SIGBUS signal(SIGBUS, SIG_DFL); + #endif signal(SIGSEGV, SIG_DFL); } diff -cr --new-file andrew.orig/atk/preview/preview.c andrew/atk/preview/preview.c *** andrew.orig/atk/preview/preview.c Fri Jan 24 04:04:41 1992 --- andrew/atk/preview/preview.c Sun Sep 5 10:52:30 1993 *************** *** 38,43 **** --- 38,50 ---- #include <message.ih> #endif /* USEFRAME */ + + #if defined(linux) || defined(HAVE_STREAMBUF) + #define FILE_USED(f) ((f)->_egptr - (f)->_gptr) + #else + #define FILE_USED(f) ((f)->_cnt) + #endif + #define ResetOffsets(self) if(! self->DoScaling ) self->yoff = self->xoff = 0; static SetTitle(self) struct preview *self; *************** *** 447,453 **** FilePosition += 1; if (self->SizeChanged) break; ! if (filein->_cnt <= 0 && !self->DviFileComplete) break; } self->lastc = lastc; --- 454,460 ---- FilePosition += 1; if (self->SizeChanged) break; ! if (FILE_USED(filein) <= 0 && !self->DviFileComplete) break; } self->lastc = lastc; *************** *** 748,754 **** /* To avoid dieing when the parent quits; reset process group id; set it to processid to be unique */ processid = getpid(); ! #ifdef hpux setpgrp(); #else /* hpux */ setpgrp(0,processid); --- 755,761 ---- /* To avoid dieing when the parent quits; reset process group id; set it to processid to be unique */ processid = getpid(); ! #if defined(hpux) || defined(linux) setpgrp(); #else /* hpux */ setpgrp(0,processid); diff -cr --new-file andrew.orig/atk/preview/previewa.c andrew/atk/preview/previewa.c *** andrew.orig/atk/preview/previewa.c Fri Jan 24 04:04:43 1992 --- andrew/atk/preview/previewa.c Sun Sep 5 10:55:06 1993 *************** *** 24,29 **** --- 24,33 ---- #include <im.ih> #include <signal.h> + #ifdef linux + #include <bsd/signal.h> + #endif + char *DviBaseName=NULL; char *DviFileName=NULL; boolean DoScaling = TRUE; diff -cr --new-file andrew.orig/atk/support/complete.c andrew/atk/support/complete.c *** andrew.orig/atk/support/complete.c Fri Jan 24 04:06:35 1992 --- andrew/atk/support/complete.c Sat Sep 4 11:04:49 1993 *************** *** 26,32 **** #include <sys/param.h> #include <sys/stat.h> ! #ifdef M_UNIX #include <dirent.h> #define direct dirent #else --- 26,32 ---- #include <sys/param.h> #include <sys/stat.h> ! #if defined(M_UNIX) || defined(linux) #include <dirent.h> #define direct dirent #else diff -cr --new-file andrew.orig/atk/support/print.c andrew/atk/support/print.c *** andrew.orig/atk/support/print.c Fri Jan 24 04:06:48 1992 --- andrew/atk/support/print.c Sat Sep 4 12:06:45 1993 *************** *** 377,383 **** #ifdef hpux setpgrp2(0, pg = getpid()); #else /* hpux */ ! #ifdef SGI_4D_ENV setpgrp(); #else setpgrp(0, pg = getpid()); --- 377,383 ---- #ifdef hpux setpgrp2(0, pg = getpid()); #else /* hpux */ ! #if defined(SGI_4D_ENV) || defined(linux) setpgrp(); #else setpgrp(0, pg = getpid()); diff -cr --new-file andrew.orig/atk/supportviews/Imakefile andrew/atk/supportviews/Imakefile *** andrew.orig/atk/supportviews/Imakefile Fri Jan 24 04:07:15 1992 --- andrew/atk/supportviews/Imakefile Tue Sep 7 10:01:46 1993 *************** *** 13,19 **** palette.do \ sbutton.do \ sbuttonv.do \ ! sbttnav.do \ scroll.do \ strtbl.do \ strtblv.do --- 13,19 ---- palette.do \ sbutton.do \ sbuttonv.do \ ! sbttnav.do \ scroll.do \ strtbl.do \ strtblv.do *************** *** 28,34 **** oscroll.ih \ palette.ih \ sbutton.ih \ ! sbuttonv.ih \ sbttnav.ih \ scroll.ih \ strtbl.ih \ --- 28,34 ---- oscroll.ih \ palette.ih \ sbutton.ih \ ! sbuttonv.ih \ sbttnav.ih \ scroll.ih \ strtbl.ih \ *************** *** 43,50 **** matte.o \ oscroll.o \ sbutton.o \ ! sbuttonv.o \ ! sbttnav.o \ palette.o \ scroll.o \ strtbl.o \ --- 43,50 ---- matte.o \ oscroll.o \ sbutton.o \ ! sbuttonv.o \ ! sbttnav.o \ palette.o \ scroll.o \ strtbl.o \ diff -cr --new-file andrew.orig/atk/text/txtvcmds.c andrew/atk/text/txtvcmds.c *** andrew.orig/atk/text/txtvcmds.c Sun Mar 1 07:43:10 1992 --- andrew/atk/text/txtvcmds.c Thu Sep 9 13:18:32 1993 *************** *** 499,505 **** { struct keymap *newKeymap = keymap_New(); register long i; ! char str[2]; struct proctable_Entry *si; if(normalMenus!=NULL) --- 499,505 ---- { struct keymap *newKeymap = keymap_New(); register long i; ! unsigned char str[2]; struct proctable_Entry *si; if(normalMenus!=NULL) diff -cr --new-file andrew.orig/atk/text/txtvcmod.c andrew/atk/text/txtvcmod.c *** andrew.orig/atk/text/txtvcmod.c Fri Jan 24 04:09:52 1992 --- andrew/atk/text/txtvcmod.c Thu Sep 9 13:18:32 1993 *************** *** 123,129 **** void textview_SelfInsertCmd(self, a) register struct textview *self; ! char a; { register int ct, i, pos; register struct text *d; --- 123,129 ---- void textview_SelfInsertCmd(self, a) register struct textview *self; ! unsigned char a; { register int ct, i, pos; register struct text *d; *************** *** 1449,1455 **** void textview_DigitCmd(self, c) struct textview *self; ! register char c; { struct im *im = textview_GetIM(self); --- 1449,1455 ---- void textview_DigitCmd(self, c) struct textview *self; ! register unsigned char c; { struct im *im = textview_GetIM(self); diff -cr --new-file andrew.orig/atk/textobjects/dired.c andrew/atk/textobjects/dired.c *** andrew.orig/atk/textobjects/dired.c Fri Jan 24 04:10:56 1992 --- andrew/atk/textobjects/dired.c Sat Sep 4 11:06:13 1993 *************** *** 6,12 **** #include <class.h> #include <andrewos.h> ! #ifdef M_UNIX #include <dirent.h> #define direct dirent #else --- 6,12 ---- #include <class.h> #include <andrewos.h> ! #if defined(M_UNIX) || defined(linux) #include <dirent.h> #define direct dirent #else diff -cr --new-file andrew.orig/atk/typescript/tscript.c andrew/atk/typescript/tscript.c *** andrew.orig/atk/typescript/tscript.c Fri Jan 24 04:10:45 1992 --- andrew/atk/typescript/tscript.c Sat Sep 4 12:06:46 1993 *************** *** 48,53 **** --- 48,59 ---- #include <sys/ptem.h> #endif + #if defined(linux) || defined(HAVE_STREAMBUF) + #define FILE_USED(f) ((f)->_egptr - (f)->_gptr) + #else + #define FILE_USED(f) ((f)->_cnt) + #endif + #include <signal.h> #if defined(POSIX_ENV) && !defined(sun) *************** *** 992,998 **** register char *cp; register c; register int i = *bufsiz; ! for(cp = buf; --i && f->_cnt > 0; cp++) { if((c = getc(f)) == EOF) { im_RemoveFileHandler(f); self->SubChannel = -1; --- 998,1004 ---- register char *cp; register c; register int i = *bufsiz; ! for(cp = buf; --i && FILE_USED(f) > 0; cp++) { if((c = getc(f)) == EOF) { im_RemoveFileHandler(f); self->SubChannel = -1; *************** *** 1044,1050 **** } else if(c != '\015') *bp++ = c; ! while(--i && f->_cnt > 0) { if((c = getc(f)) == EOF) break; if(odf) --- 1050,1056 ---- } else if(c != '\015') *bp++ = c; ! while(--i && FILE_USED(f) > 0) { if((c = getc(f)) == EOF) break; if(odf) *************** *** 1166,1172 **** { int pid; char **arglist = NULL; ! #ifdef SGI_4D_ENV int pgrp = getpgrp(); #else int pgrp = getpgrp(0); --- 1172,1178 ---- { int pid; char **arglist = NULL; ! #if defined(SGI_4D_ENV) || defined(linux) int pgrp = getpgrp(); #else int pgrp = getpgrp(0); diff -cr --new-file andrew.orig/atk/zip/lib/zip.h andrew/atk/zip/lib/zip.h *** andrew.orig/atk/zip/lib/zip.h Fri Jan 24 04:13:12 1992 --- andrew/atk/zip/lib/zip.h Wed Sep 8 23:31:29 1993 *************** *** 108,113 **** --- 108,114 ---- #ifndef DEBUG char debug; #ifdef DB + #ifndef __STDC__ #define IN( x ) if ( debug ) printf( ">x\n" ); #define OUT( x ) if ( debug ) printf( "<x\n" ); #define DEBUG( y ) if ( debug ) printf( " %s\n", "y" ); *************** *** 121,126 **** --- 122,142 ---- #define DEBUGgt( t, y ) if ( debug ) printf( " t: %g\n", y ); #define DEBUGx( y ) if ( debug ) printf( " %x\n", y ); #define DEBUGxt( t, y ) if ( debug ) printf( " t: %x\n", y ); + #else + #define IN( x ) if ( debug ) printf( ">" #x "\n" ); + #define OUT( x ) if ( debug ) printf( "<" #x "\n" ); + #define DEBUG( y ) if ( debug ) printf( " %s\n", #y ); + #define DEBUGc( y ) if ( debug ) printf( " '%c'\n", #y ); + #define DEBUGct( t, y ) if ( debug ) printf( " t: '%c'\n", y ); + #define DEBUGs( y ) if ( debug ) printf( " '%s'\n", #y ); + #define DEBUGst( t, y ) if ( debug ) printf( " t: '%s'\n", y ); + #define DEBUGd( y ) if ( debug ) printf( " %d\n", y ); + #define DEBUGdt( t, y ) if ( debug ) printf( " t: %d\n", y ); + #define DEBUGlt( t, y ) if ( debug ) printf( " t: %D\n", y ); + #define DEBUGgt( t, y ) if ( debug ) printf( " t: %g\n", y ); + #define DEBUGx( y ) if ( debug ) printf( " %x\n", y ); + #define DEBUGxt( t, y ) if ( debug ) printf( " t: %x\n", y ); + #endif /* __STDC__ */ #else /* DB */ #define IN( x ) #define OUT( x ) diff -cr --new-file andrew.orig/atkams/messages/lib/stubs.c andrew/atkams/messages/lib/stubs.c *** andrew.orig/atkams/messages/lib/stubs.c Fri Jan 24 04:16:06 1992 --- andrew/atkams/messages/lib/stubs.c Sat Sep 4 12:06:48 1993 *************** *** 189,194 **** --- 189,197 ---- sprintf(Msg, "Dumping core in directory %s", CoreDirectory); errprintf(im_GetProgramName(), ERR_CRITICAL, 0, 0, Msg); ReportSuccess(Msg); + #ifndef SIGBUS + #define SIGBUS SIGSEGV + #endif kill(getpid(), SIGBUS); return(-1); /* Hah! That's what you think, you stupid compiler. */ } diff -cr --new-file andrew.orig/atkams/messages/lib/text822.c andrew/atkams/messages/lib/text822.c *** andrew.orig/atkams/messages/lib/text822.c Fri Apr 10 05:01:39 1992 --- andrew/atkams/messages/lib/text822.c Sat Sep 4 12:06:48 1993 *************** *** 637,643 **** } else { strcpy(Label, "Object of type '"); strncat(Label, ContentTypeOverride, sizeof(Label) - 25); ! strncat(Label, "'"); } mailobj_SetLabel(mo, 0, Label); } --- 637,643 ---- } else { strcpy(Label, "Object of type '"); strncat(Label, ContentTypeOverride, sizeof(Label) - 25); ! strcat(Label, "'"); } mailobj_SetLabel(mo, 0, Label); } diff -cr --new-file andrew.orig/config/i386_linux/system.h andrew/config/i386_linux/system.h *** andrew.orig/config/i386_linux/system.h --- andrew/config/i386_linux/system.h Mon Sep 6 21:13:07 1993 *************** *** 0 **** --- 1,93 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1991 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + #ifndef SYSTEM_H + #define SYSTEM_H + + /* Get common definitions */ + #include <allsys.h> + + #define OPSYSNAME "i386_linux" + #define SYS_NAME "i386_linux" + #define vax2 1 + #define sys_vax_43 1 + #define VAX_ENV 1 + + #undef ANDREW_MALLOC_ENV /* conflicts with linux shared libs */ + /* somehow. Don't have time to fix, */ + /* and linux mallocer has all the */ + /* features of andrew anyway. */ + + #define POSIX_ENV 1 /* roll on POSIX.. */ + + /* #define M_UNIX */ /* Would like to define this for the directory */ + /* handleing, but unfortunately, it is used for time handleing as */ + /* well. */ + + #define FNDELAY O_NDELAY /* cos linux is a posix env, and */ + /* doesn't have REALLY old junk.. :) */ + + #define NDEBUG /* some places use asserts()'s, but */ + /* linux doesn't have ___eprintf() in */ + /* the shared libs for some reason. So */ + /* we just turn them off. */ + + /* Here follow the overrides for this system. */ + #undef SY_B43 + #define SY_B43 1 /* This system is most like bsd 4.3 */ + + #ifndef In_Imake + + /* Get major data types (esp. caddr_t) */ + #include <sys/types.h> + #include <unistd.h> + /* Get open(2) constants */ + #include <sys/file.h> + + #include <strings.h> + + /* Get struct timeval */ + #include <sys/time.h> + + /* include path for syslog.h */ + #include <syslog.h> + + /* VMUNIX vs. SY_B4x */ + #ifndef VMUNIX + #define VMUNIX 1 + #endif VMUNIX + + #define OSI_HAS_SYMLINKS 1 + #define osi_readlink(PATH,BUF,SIZE) readlink((PATH),(BUF),(SIZE)) + + #define osi_ExclusiveLockNoBlock(fid) flock((fid), LOCK_EX | LOCK_NB) + #define osi_UnLock(fid) flock((fid), LOCK_UN) + #define osi_O_READLOCK O_RDONLY + #define osi_F_READLOCK "r" + + #define osi_vfork() fork() + + #define osi_setjmp _setjmp + #define osi_longjmp _longjmp + + /* Make a time standard. */ + struct osi_Times {unsigned long int Secs; unsigned long int USecs;}; + /* Set one of the above with a call to osi_GetTimes(&foo) */ + #define osi_GetSecs() time((long int *) 0) + extern void osi_SetZone(); + extern char *osi_ZoneNames[]; + extern long int osi_SecondsWest; + extern int osi_IsEverDaylight; + + /* Put system-specific definitions here */ + + #define HAS_SYSEXITS 1 + + #endif /* !In_Imake */ + + /* Now follow the site-specific customizations. */ + #include <site.h> + + #endif /* SYSTEM_H */ + diff -cr --new-file andrew.orig/config/i386_linux/system.mcr andrew/config/i386_linux/system.mcr *** andrew.orig/config/i386_linux/system.mcr --- andrew/config/i386_linux/system.mcr Thu Sep 9 08:14:29 1993 *************** *** 0 **** --- 1,27 ---- + /* Copyright IBM Corporation 1988,1991 - All Rights Reserved */ + /* For full copyright information see:'andrew/config/COPYRITE' */ + + #define In_Imake 1 + /* The next two lines need to be kept in sync */ + #include <i386_linux/system.h> + SYSTEM_H_FILE = i386_linux/system.h + #undef In_Imake + + /* These next two lines help configure the embedded machine-dependent + directories overhead/class/machdep, atk/console/stats, and + atk/console/stats/common. */ + SYS_IDENT = i386_linux + SYS_OS_ARCH = i386_linux + + + /* Get parent inclusions */ + #include <allsys.mcr> + + /* Now for the system-dependent information. */ + + CDEBUGFLAGS = -O -fwritable-strings -D_BSD_SOURCE + CSHELL = tcsh + /* Get site-specific inclusions */ + #include <site.mcr> + + #define SITE_ENV diff -cr --new-file andrew.orig/config/platform.tmpl andrew/config/platform.tmpl *** andrew.orig/config/platform.tmpl Tue Apr 7 01:23:02 1992 --- andrew/config/platform.tmpl Sat Sep 4 10:54:55 1993 *************** *** 150,155 **** --- 150,160 ---- #define MacroIncludeFile next_mach20/system.mcr #endif /* next_mach20 */ + #ifdef linux + #include <i386_linux/system.mcr> + #define MacroIncludeFile i386_linux/system.mcr + #endif + /**/# /**/# Back from the macro file /**/# diff -cr --new-file andrew.orig/config/site.h andrew/config/site.h *** andrew.orig/config/site.h Wed Apr 8 06:47:59 1992 --- andrew/config/site.h Mon Sep 6 21:29:06 1993 *************** *** 1,3 **** --- 1,9 ---- /* CMU-local overrides to the distributed system.mcr file. The distributed version */ /* of this file is empty, and patches are never sent for it. */ + + #define CONTRIB_ENV + #define MK_BASIC_UTILS + #define MK_AUTHORING + #define MK_AUX_UTILS + #define MK_AUX_INSETS diff -cr --new-file andrew.orig/config/site.mcr andrew/config/site.mcr *** andrew.orig/config/site.mcr Wed Apr 8 06:48:15 1992 --- andrew/config/site.mcr Tue Sep 7 09:57:18 1993 *************** *** 1,2 **** --- 1,4 ---- /* CMU-local overrides to the distributed system.mcr file. The distributed version */ /* of this file is empty, and patches are never sent for it. */ + + LINKFLAGS=-O diff -cr --new-file andrew.orig/config/site.rls andrew/config/site.rls *** andrew.orig/config/site.rls Fri Jan 24 03:37:59 1992 --- andrew/config/site.rls Tue Sep 7 09:56:24 1993 *************** *** 5,7 **** --- 5,32 ---- /* Empty site.rls file. Use this file to hold all */ /* your site's additions to andrew.rls. */ + #undef NormalAsmPPRule + #define NormalAsmPPRule() @@\ + .spp.o: @@\ + $(RM) $@ ,$*.s ,$*.c @@\ + $(CP) $*.spp ,$*.c @@\ + $(ASMPP_CC) $(CFLAGS) ,$*.c | $(TR) ';' '\n' > ,$*.s @@\ + $(AS) $(AS_FLAGS) -o $*.o ,$*.s @@\ + $(RM) ,$*.c ,$*.s + + #undef TestProgramTarget + #define TestProgramTarget(program, objs, libs, syslibs) @@\ + test:: program @@\ + program: objs libs @@\ + $(RM) $@ @@\ + $(CC) $(LINKFLAGS) -o $@ objs libs syslibs @@\ + clean:: ; $(RM) program + + #undef ProgramTarget + #define ProgramTarget(program, objs, libs, syslibs) @@\ + all:: program @@\ + program: objs libs @@\ + $(RM) $@ @@\ + $(CC) $(LINKFLAGS) -o $@ objs libs syslibs @@\ + clean:: ; $(RM) program + diff -cr --new-file andrew.orig/contrib/mit/2rtf/main.c andrew/contrib/mit/2rtf/main.c *** andrew.orig/contrib/mit/2rtf/main.c Sat Feb 15 01:55:08 1992 --- andrew/contrib/mit/2rtf/main.c Sun Sep 5 11:21:18 1993 *************** *** 24,31 **** $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/2rtf/RCS/main.c,v 1.2 1992/02/14 17:53:38 gk5g Exp $ */ ! ! #include <stdio.h> #include <sys/file.h> /* access() */ #include <sys/errno.h> --- 24,32 ---- $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/2rtf/RCS/main.c,v 1.2 1992/02/14 17:53:38 gk5g Exp $ */ ! #ifdef linux ! #include <unistd.h> /* get R_OK etc.. */ ! #endif #include <stdio.h> #include <sys/file.h> /* access() */ #include <sys/errno.h> diff -cr --new-file andrew.orig/contrib/mit/annot/iconview.c andrew/contrib/mit/annot/iconview.c *** andrew.orig/contrib/mit/annot/iconview.c Fri Jan 24 04:19:23 1992 --- andrew/contrib/mit/annot/iconview.c Sun Sep 5 11:18:36 1993 *************** *** 26,32 **** #include "keymap.ih" #include "buffer.ih" #include <im.ih> ! static struct iconview *First; /* Global determines if new icon views will draw open or closed. */ --- 26,34 ---- #include "keymap.ih" #include "buffer.ih" #include <im.ih> ! #ifdef linux ! #include <bsd/bsd.h> /* suck in MIN defn. */ ! #endif static struct iconview *First; /* Global determines if new icon views will draw open or closed. */ diff -cr --new-file andrew.orig/contrib/mit/rtf2/main.c andrew/contrib/mit/rtf2/main.c *** andrew.orig/contrib/mit/rtf2/main.c Thu Mar 5 01:27:46 1992 --- andrew/contrib/mit/rtf2/main.c Sun Sep 5 11:21:52 1993 *************** *** 26,32 **** $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/rtf2/RCS/main.c,v 1.2 1992/03/04 17:26:42 gk5g Exp $ */ ! #include <stdio.h> #include <sys/file.h> /* access() */ #include <sys/errno.h> --- 26,34 ---- $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/rtf2/RCS/main.c,v 1.2 1992/03/04 17:26:42 gk5g Exp $ */ ! #ifdef linux ! #include <unistd.h> /* get R_OK et al */ ! #endif #include <stdio.h> #include <sys/file.h> /* access() */ #include <sys/errno.h> diff -cr --new-file andrew.orig/overhead/class/lib/class.c andrew/overhead/class/lib/class.c *** andrew.orig/overhead/class/lib/class.c Fri Jan 24 04:23:00 1992 --- andrew/overhead/class/lib/class.c Sat Sep 4 12:06:49 1993 *************** *** 30,36 **** #include <class.h> /* this contains all the structs, etc. for the class system */ #include <doload.h> #include <errno.h> ! /* external symbols that have no include files */ --- 30,38 ---- #include <class.h> /* this contains all the structs, etc. for the class system */ #include <doload.h> #include <errno.h> ! #ifdef linux ! #include <bsd/signal.h> ! #endif /* external symbols that have no include files */ diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/Imakefile andrew/overhead/class/machdep/i386_linux/Imakefile *** andrew.orig/overhead/class/machdep/i386_linux/Imakefile --- andrew/overhead/class/machdep/i386_linux/Imakefile Mon Sep 6 20:23:16 1993 *************** *** 0 **** --- 1,75 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1991 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + #define GNU_ENV + #if 0 + LIBC=/usr/lib/libg.a + GNULIB=/usr/lib/libgcc.a + #else + LIBC=/usr/lib/libc.sa + GNULIB=/usr/lib/libgcc.sa + #endif + DependTarget(globalrefs._h) + + NormalObjectRule() + NormalAsmPPRule() + + #ifdef RESOLVER_ENV + RESOLVER_LIB = $(RESOLVLIB) + LIBC_RESOLVER_LIST = gethostnamadr.o gethostent.o res_comp.o res_debug.o res_init.o res_mkquery.o res_send.o sethostent.o res_search.o + RESOLVER_SPLIT_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \ + then ar x $(RESOLVER_LIB); fi; exit 0'; + LIBC_RESOLVER_HACK = /bin/sh -c 'if test $(RESOLVER_LIB); \ + then ar d libcx.a $(LIBC_RESOLVER_LIST); fi; exit 0'; + #endif + + all:: globals.o entry.o doload.o + + globals.o: globals.spp globalrefs._h + + globalrefs._h: libc.eplist + $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h + $(MV) ,globalrefs._h globalrefs._h + + libc.eplist: $(LIBC) /usr/lib/crt0.o $(RESOLVER_LIB) ${GNULIB} getlist.awk + $(RM) /tmp/libhack.a + $(AR) /tmp/libhack.a /usr/lib/crt0.o + $(NM) -go --no-cplus $(RESOLVER_LIB) $(LIBC) ${GNULIB} /tmp/libhack.a | $(TR) ":()" " " | \ + $(AWK) -f getlist.awk >,libc.eplist + $(MV) ,libc.eplist libc.eplist + $(RM) /tmp/libhack.a + + InstallLibrary(libcx.a, $(DESTDIR)/lib) + InstallCshScript(makedo.csh, $(DESTDIR)/bin/makedo) + + #ifdef GNU_ENV + ARCHIVE_COM = ar x ${GNULIB} ; + #endif /* GNU_ENV */ + + all:: libcx.a + + DelList._: libc.eplist + touch DelList._ + # $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ + # $(MV) ,DelList._ DelList._ + + libcx.a: $(LIBC) /usr/lib/crt0.o $(RESOLVER_LIB) ${GNULIB} DelList._ + rm -rf new + mkdir new + cd new ; \ + $(RESOLVER_SPLIT_CMD) \ + $(CP) /usr/lib/crt0.o crt0.o ; \ + $(CP) $(LIBC) ,libcx.a ; $(ARCHIVE_COM) \ + $(CHMODW) ,libcx.a ; \ + ar q ,libcx.a *.o + mv new/,libcx.a libcx.a + -ar d libcx.a `cat DelList._` + $(LIBC_RESOLVER_HACK) + $(RANLIB) libcx.a + rm -rf new + + all:: dofix.o + + clean:: + $(RM) DelList._ libc.eplist globalrefs._h ,* libcx.a diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/aixfix.h andrew/overhead/class/machdep/i386_linux/aixfix.h *** andrew.orig/overhead/class/machdep/i386_linux/aixfix.h --- andrew/overhead/class/machdep/i386_linux/aixfix.h Mon Sep 6 19:30:46 1993 *************** *** 0 **** --- 1,39 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1991 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + /* MACROS TO HELP PORTABILITITY */ + + #ifndef AIX + #define RP_LENGTH( rp ) ( rp->r_length ) + #define IS_RP_EXTERN( rp ) ( rp->r_extern ) + #define IS_RP_PC_REL( rp ) ( rp->r_pcrel ) + #define SYM_TYPE( sp ) ( sp->n_type & N_TYPE ) + #define IS_EXTERN_SYM( sp ) ( sp->n_type & N_EXT ) + #else + #define nlist syment + #define r_address r_vaddr + #define r_symbolnum r_symndx + #define relocation_info reloc + #define N_EXT C_EXT + #define N_TYPE N_SECT + #define RP_LENGTH( rp ) ( \ + ( ( rp->r_type == 2 ) || ( rp->r_type == 3 ) ) ? 0 \ + : ( ( ( rp->r_type == 4 ) || ( rp->r_type == 5 ) ) ? 1 \ + : ( ( ( rp->r_type == 6 ) || ( rp->r_type == 7 ) \ + || ( rp->r_type == 9 ) || ( rp->r_type == 12 ) ) ? 2 \ + : ( ( rp->r_type == 8 ) ? 3 \ + : /* rp->r_type == R_ABS or R_SEG86 or R_SEG286 */ -1 ) ) ) ) + #define IS_RP_EXTERN( rp ) ( ( rp->r_symndx & S_BSS ) != S_BSS ) + #define IS_RP_PC_REL( rp ) ( \ + ( rp->r_type == 3 ) || ( rp->r_type == 5 ) \ + || ( rp->r_type == 7 ) || ( rp->r_type == 9 ) \ + || ( rp->r_type == 12 ) ) + #define SYM_TYPE( sp ) ( sp->n_sclass & N_SECT ) + #define IS_EXTERN_SYM( sp ) ( ( sp->n_sclass & N_CLASS ) == C_EXT ) + #define N_BADMAG( x ) BADMAG( x ) + #define N_TXTOFF( x ) A_TEXTPOS( x ) + #endif + + diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/dofix.c andrew/overhead/class/machdep/i386_linux/dofix.c *** andrew.orig/overhead/class/machdep/i386_linux/dofix.c --- andrew/overhead/class/machdep/i386_linux/dofix.c Mon Sep 6 19:30:46 1993 *************** *** 0 **** --- 1,310 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1991 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + static char *dofix_rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/class/machdep/i386_mach/RCS/dofix.c,v 1.2 1991/09/12 17:05:23 bobg Exp $"; + + /* + dofix.c - convert .o file into .do file + + Author: John H Howard - April 9, 1987 + */ + + + #include <stdio.h> + #include <andrewos.h> /* sys/file.h */ + #include <a.out.h> + #include <setjmp.h> + #include <doload.h> + + #include <aixfix.h> + + #include <../common/safe.h> + + /* set entry point */ + + /* + * NOTE - The RT uses entry points in the data segment, rather + * than the text segment as is usually the case. In order to + * allow this, we represent data segment entry points by adding + * the text segment size to the offset within the data segment. + */ + + FixEntryPoint(e, EntryPointName) + register struct doload_environment *e; + char *EntryPointName; + { + register struct nlist *sp; + register struct nlist *sbound; + if (EntryPointName == NULL || *EntryPointName == NULL) + return; + sp = e->symtab; + sbound = (struct nlist *)((char *)sp + e->header.a_syms); + for (; sp < sbound; sp++) { + if ( SYM_TYPE( sp ) != N_UNDF + && (IS_EXTERN_SYM( sp ) && !(sp->n_type & N_STAB)) + && strcmp( EntryPointName, + ((sp->n_un.n_strx) + ? (e->stringtab + sp->n_un.n_strx) + : "<<noname>>") ) == 0 ) + { + switch ( SYM_TYPE(sp) ) { + case N_DATA: + case N_TEXT: + e->header.a_entry = sp->n_value; + break; + default: + fprintf( stderr, + "dofix: invalid entry point relocation %x\n", SYM_TYPE(sp) ) ; + e->problems++; + } /* end of switch */ + return; + } /* end of name match */ + } /* end of loop */ + fprintf(stderr, "dofix: entry point %s undefined\n", EntryPointName); + e->problems++; + return; + } + + /* fix up one relocation table entry */ + + extern struct globaltab { + long entrypoint; /* entry point value */ + char *entryname; /* symbolic name */ + } globals[]; + extern long globalcount; + + FixRelocation(e, rp) + register struct doload_environment *e; + register struct relocation_info *rp; + { + register int i; + register int j; + + if ( IS_RP_EXTERN( rp ) ) { + register struct nlist *sp = e->symtab + rp->r_symbolnum; + char *np = ((sp->n_un.n_strx) ? ( e->stringtab + sp->n_un.n_strx ) + : "<<noname>>" ) ; + if ( SYM_TYPE(sp) == N_UNDF) { + if (sp->n_value == 0) { + for (i = globalcount; --i >= 0 ;) + if (strcmp(globals[i].entryname, np) == 0) + break; + if (i < 0) { + fprintf(stderr, "dofix: Undefined: %s\n", np); + e->problems++; + } + } + for ( j = e->newsymcount ; + --j >= 0 + && strcmp(e->stringtab + e->newsym[j].n_un.n_strx, np) != 0; ) ; + if (j < 0) { + j = e->newsymcount++; + e->newsym = (struct nlist *) + safe_realloc( e, (char *) e->newsym, + e->newsymcount * sizeof *(e->newsym)); + bcopy(sp, e->newsym + j, sizeof *sp); + } + if (sp->n_value > e->newsym[j].n_value) + e->newsym[j].n_value = sp->n_value; + rp->r_symbolnum = j; + } /* endif N_UNDF */ + else if ( SYM_TYPE(sp) != N_ABS) { + fprintf( stderr, + "dofix: Relocatable symbol value (%s = %d, type %d)\n", + np, sp->n_value, SYM_TYPE(sp) ); + e->problems++; + } + else if (sp->n_value != 0) { + fprintf( stderr, "dofix: Nonzero symbol value (%s = %d)\n", + np, sp->n_value); + e->problems++; + } + } + + return; + } + + /* write new symbol table */ + + WriteNewSym(e, outFD) + register struct doload_environment *e; + int outFD; + { + register int i; + register char *newcp; + long newstringsize; + char *newstrings = NULL; + + /* allocate new string table */ + + for (newstringsize = sizeof newstringsize, i = e->newsymcount; --i >= 0; ) + newstringsize += strlen(e->stringtab + e->newsym[i].n_un.n_strx) + 1; + if (doload_trace) + printf( " new symbol count %d, new string size %d\n", + e->newsymcount, newstringsize ) ; + newcp = newstrings = safe_malloc(e, newstringsize); + *(long *)newcp = newstringsize; + newcp += sizeof newstringsize; + + /* make a new string table */ + + for (i = 0; i < e->newsymcount; i++) { + register char *oldcp ; + register int n ; + + oldcp = e->stringtab + e->newsym[i].n_un.n_strx ; + n = strlen(oldcp) + 1; + bcopy(oldcp, newcp, n); + e->newsym[i].n_un.n_strx = newcp - newstrings; + newcp += n; + } + + /* write symbols and strings */ + + safe_write( e, outFD, (char *) e->newsym, + e->newsymcount * sizeof (struct nlist) ); + safe_write(e, outFD, newstrings, newstringsize); + + /* clean up */ + + safe_free(newstrings); + + return; + } + + /* read, fix, and write out module */ + + FixIt(inFD, outFD, EntryPointName) + int inFD; /* open fd for .o file */ + int outFD; /* open fd for .do file */ + char *EntryPointName; /* entry point name */ + { + struct doload_environment E; + register struct doload_environment *e; + unsigned long n; /* number of relocation items */ + struct relocation_info *rp; + + if (doload_trace) + printf("FixIt(%d, %d, %s)\n", inFD, outFD, EntryPointName); + + /* set up environment */ + + doload_setup(e = &E, inFD, Fix); + if (setjmp(e->errorJump)) { + doload_cleanup(e); + return; + } + + /* read module into memory */ + doload_read(e); + + /* repair relocation tables */ + rp = e->rtab; + for ( n = (e->header.a_trsize + e->header.a_drsize)/(sizeof *rp); + n > 0; + n--, rp++) { + FixRelocation(e, rp); + } + + /* get entry point */ + FixEntryPoint(e, EntryPointName); + + /* write out result */ + e->header.a_syms = e->newsymcount * sizeof(struct nlist); + safe_write(e, outFD, (char *)&(e->header), (long)sizeof e->header); + if (lseek(outFD, (long)N_TXTOFF(e->header), 0) < 0) + doload_punt(e, "seek to write text failed"); + safe_write(e, outFD, e->text, (long)(e->header.a_text + e->header.a_data)); + safe_write(e, outFD, (char *)e->rtab, + e->header.a_trsize + e->header.a_drsize); + WriteNewSym(e, outFD); + + doload_cleanup(e); + return ; + } + + static char *ComputeOutputFileName (InputFileName, extension) + char *InputFileName; + char *extension; + { + static char name[256]; + register char *p, *q; + char *ext; + + /* copy the input name and look for the last '.' */ + + for (p = InputFileName, q = name, ext = NULL; *p != '\0';) { + if (*p == '/') /* ignore period if '/' follows */ + p++, q = name, ext = NULL; + else + if ((*q++ = *p++) == '.') + ext = q - 1; + } + if (ext == NULL) + ext = q; + *ext = '\0'; + + /* overwrite the extension with new extension */ + + strncat(name, extension, 255); + if (strcmp(InputFileName, name) == 0) + strncat(name, extension, 255); + return name ; + } + + /* main program */ + + main(argc, argp) + int argc; + char **argp; + { + int infd; + int outfd; + int gotcha = 0; + char *outname; + char *EntryPointName = NULL; + + while (--argc > 0) { + if (**++argp == '-') { + switch (*++*argp) { + case 'd': + doload_trace++; + break; + case 'e': + if (*++*argp) + EntryPointName = *argp; + else { + EntryPointName = *++argp; + argc--; + } + break; + default: + fprintf(stderr, "dofix: Unknown switch -%c ignored\n", *argp); + } + } + else { + gotcha++; + outname = ComputeOutputFileName(*argp, ".do"); + infd = open(*argp, O_RDONLY, 0); + if (infd < 0) + fprintf(stderr, "dofix: File %s not found\n", *argp); + else { + outfd = open(outname, O_WRONLY+O_CREAT+O_TRUNC, 0644); + if (outfd < 0) { + fprintf(stderr, "dofix: Can not write file %s\n", outname); + perror("dofix"); + } + else { + FixIt(infd, outfd, EntryPointName); + close(outfd); + } + close(infd); + } + } + } + if (gotcha == 0) { + FixIt(0, 1, EntryPointName); + } + exit(0); + } diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/doload.c andrew/overhead/class/machdep/i386_linux/doload.c *** andrew.orig/overhead/class/machdep/i386_linux/doload.c --- andrew/overhead/class/machdep/i386_linux/doload.c Mon Sep 6 19:30:46 1993 *************** *** 0 **** --- 1,371 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1991 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + static char *doload_rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/class/machdep/i386_mach/RCS/doload.c,v 1.2 1991/09/12 17:06:03 bobg Exp $"; + + /* + doload.c - dynamic loader for class system + + Author: John H Howard - April 4, 1987 + */ + + #include <stdio.h> + #include <a.out.h> + #include <setjmp.h> + #include <doload.h> + + #include <aixfix.h> + #include <andrewos.h> /* sys/types.h */ + #include <sys/stat.h> + + char *malloc(); + char *realloc(); + long lseek(); + + int doload_trace=0; /* nonzero if debugging */ + + #include "../common/safe.h" + + /* initialize state */ + + void doload_setup(e, inFD, mode) + struct doload_environment *e; + int inFD; + doload_mode mode; + { + e->mode = mode; + e->fd = inFD; + e->problems = 0; + e->text = NULL; + e->rtab = NULL; + e->symtab = NULL; + e->stringtab = NULL; + e->newsym = NULL; + e->newsymcount = 0; + return; + } + + /* tear down environment */ + + void doload_cleanup(e) + struct doload_environment *e; + { + if (e->problems > 0) { + e->problems = 0; + doload_punt(e, "Errors while processing"); + } + safe_free((char *)e->rtab); + safe_free((char *)e->symtab); + safe_free(e->stringtab); + safe_free((char *)e->newsym); + return ; + } + + /* read module into memory */ + + doload_read(e) + struct doload_environment *e; + { + long stringlen; /* length of string table */ + + /* read header */ + + safe_read(e, (char *)&(e->header), (long)sizeof e->header); + if (e->mode == List) + printf( "\nHEADER\n magic= %x\n text = %x\n data = %x\n\ + bss = %x\n syms = %x\n entry= %x\n trsize=%x\n drsize=%x\n", + e->header.a_info, e->header.a_text, e->header.a_data, + e->header.a_bss, e->header.a_syms, e->header.a_entry, + e->header.a_trsize, e->header.a_drsize); + if (N_BADMAG(e->header)) + doload_punt(e, "file not in loader format"); + + /* read text plus data */ + e->text = safe_malloc( e, + (long)(e->header.a_text + e->header.a_data + e->header.a_bss)); + e->data = e->text + e->header.a_text; + safe_lseek(e, (long)N_TXTOFF(e->header), 0); + safe_read(e, e->text, (long)(e->header.a_text + e->header.a_data)); + bzero(e->data + e->header.a_data, e->header.a_bss); + + /* read relocation information */ + + if (e->header.a_trsize + e->header.a_drsize > 0) { + long rsize; /* size of relocation info */ + + rsize = e->header.a_trsize + e->header.a_drsize; + e->rtab = (struct relocation_info *)safe_malloc(e, rsize); + safe_read(e, (char *)e->rtab, rsize); + } + + /* read symbol table */ + /* Hope symbol table comes Right after data relocations !! */ + e->symtab = (struct nlist *)safe_malloc(e, (long)e->header.a_syms); + safe_read(e, (char *)e->symtab, (long)e->header.a_syms); + + /* read string table */ + /* Hope string table comes Right after symbol table !! */ + if (read(e->fd, (char *)&stringlen, sizeof stringlen) == sizeof stringlen) { + e->stringtab = safe_malloc(e, stringlen); + safe_read( e, e->stringtab + sizeof stringlen, + stringlen - sizeof stringlen); + bcopy((char *)&stringlen, e->stringtab, sizeof stringlen); + } + } + + /* read and relocate module */ + void *(* doload(inFD, name, bp, lenP, path) )() + /* or NULL if error */ + int inFD; /* open fd for package file */ + char *name; /* name of package being loaded */ + char **bp; /* base address of package */ + long *lenP; /* size of text segment */ + char *path; /* Pathname of package being loaded */ + /* Path is used by the MACH loader, not this one */ + { + struct doload_environment E; + register struct doload_environment *e; + unsigned long n; /* number of relocation items */ + struct relocation_info *rp; + + /* set up environment */ + + doload_setup(e = &E, inFD, Load); + if (setjmp(e->errorJump)) { + doload_cleanup(e); + return NULL; + } + + /* read module into memory */ + + doload_read(e); + + /* do relocation */ + + if (e->header.a_syms) + doload_preset(e); + rp = e->rtab; + for (n = (e->header.a_trsize)/(sizeof *rp); n > 0; n--, rp++) { + doload_relocate(e, e->text + rp->r_address, rp); + } + for (n = (e->header.a_drsize)/(sizeof *rp); n > 0; n--, rp++) { + doload_relocate(e, e->data + rp->r_address, rp); + } + + /* all done */ + + if (doload_trace) + printf( " %s: text = 0x%.8x data = 0x%.8x entry = 0x%.8x\n", + name, e->text, e->data, e->text + e->header.a_entry); + + if(bp!=NULL) *bp = e->text; + if(lenP!=NULL) *lenP = e->header.a_text; + + doload_cleanup(e); + + return (void *(*)()) (e->text + e->header.a_entry); + } + + extern struct globaltab { + long entrypoint; /* entry point value */ + char *entryname; /* symbolic name */ + } globals[]; + extern long globalcount; + + /* preset global symbols */ + + static char *symtypename[] = {"UNDF", "ABS ", "TEXT", "DATA", "BSS ", "????" }; + + + char *RelocType(i) + int i; + { + i = (i & N_TYPE) >> 1; + return symtypename[i <= 4 ? i : 5]; + } + + doload_preset(e) + register struct doload_environment *e; + { + register struct nlist *sp; + register struct nlist *sbound; + + sp = e->symtab; + sbound = (struct nlist *)((char *)sp + e->header.a_syms); + + for (; sp < sbound; sp++) { + char *np = ((sp->n_un.n_strx) + ? (e->stringtab + sp->n_un.n_strx) : "<<noname>>" ) ; + + if (e->mode == List) { + printf( " %.2x %.2x %.4x %.8x %s %s %s\n", + sp->n_type, sp->n_other, sp->n_desc, sp->n_value, + RelocType(sp->n_type), + ( IS_EXTERN_SYM( sp ) ? "EXT " : " "), + np ); + } + else if ( SYM_TYPE(sp) == N_UNDF) { + register int i; + + for (i = globalcount; + --i >= 0 && strcmp(globals[i].entryname, np) != 0; ) ; + if (i >= 0) + sp->n_value = globals[i].entrypoint; + else if (sp->n_value > 0) { + + unsigned long length = sp->n_value; + + sp->n_value = (unsigned long)safe_malloc(e, length); + bzero(sp->n_value, length); + } + else { + fprintf(stderr, "doload: Undefined symbol: %s\n", np); + e->problems++; + } + sp->n_type = N_ABS + N_EXT; + } /* endif N_UNDF */ + } + } + + /* compute relocation adjustment */ + + long adjust(e, tw, rp, format) + register struct doload_environment *e; + register long tw; + register struct relocation_info *rp; + char *format; + { + if (e->mode == List) + printf(" %s", format); + if (IS_RP_EXTERN( rp )) { + register struct nlist *sp = e->symtab + rp->r_symbolnum; + char *np = ((sp->n_un.n_strx) + ? (e->stringtab + sp->n_un.n_strx) : "<<noname>>"); + if (e->mode == List) { + if (tw) + (void) printf("%x+", tw); + } + if ( SYM_TYPE(sp) == N_UNDF && e->mode == Load) + doload_punt(e, + "Internal botch - should have resolved in doload_preset"); + if (e->mode == List) + (void) printf( "%s=%x<%s>", np, sp->n_value, + RelocType(sp->n_type)); + else { + tw += sp->n_value; + switch ( SYM_TYPE(sp) ) { + case N_DATA: + case N_BSS: + case N_TEXT: + tw += (long) e->text; + case N_ABS: + break; + case N_UNDF: + if (IS_EXTERN_SYM( sp )) + break; + default: + fprintf(stderr, "doload: Unknown relocation in symbol.\n"); + fprintf( stderr, " reltab: %.8x %.6x %.2x\n", + rp->r_address, rp->r_symbolnum, *((char *)rp + 7)); + fprintf( stderr, + " symtab[%.6x]: %.8x %.2x %.2x %.4x %.8x %s\n", + rp->r_symbolnum, sp->n_un.n_strx, sp->n_type, + sp->n_other, sp->n_desc, sp->n_value, np); + e->problems++; + } + } + } /* endif IS_RP_EXTERN( rp ) */ + else { + if (e->mode == List) + printf( "%x<%s>", tw, + RelocType(rp->r_symbolnum)); + switch (rp->r_symbolnum & N_TYPE) + { + case N_DATA: + case N_BSS: + case N_TEXT: + tw += (long) e->text; + break; + case N_ABS: + if ((tw & 0xf00f0000) == 0xa0080000) { + register int i = (tw >> 20) & 0xFF; + char *np = (i < globalcount) + ? globals[i].entryname : "**INDEX TOO LARGE**"; + if (e->mode == List) + printf(" >>%s<<", np); + else if (i >= globalcount) { + fprintf(stderr, "doload: special index invalid\n"); + e->problems++; + } + else { + tw = globals[i].entrypoint; + } + } + break; + default: + doload_punt(e, "unknown symbol type"); + } /* end switch */ + } /* end else */ + return tw; + } + + /* relocate one item */ + + doload_relocate(e, cp, rp) + register struct doload_environment *e; + register char *cp; + register struct relocation_info *rp; + { + register long tw; + + switch (RP_LENGTH( rp )) { + case 0: /* 1 byte */ + tw = *cp; + if (IS_RP_PC_REL( rp )) { + tw += rp->r_address; + tw = adjust(e, tw, rp, "(pcrel)"); + tw -= (long)cp; + } + else + tw = adjust(e, tw, rp, "(char)"); + if (e->mode == Load) { + if (tw < -128 || tw > 127) + doload_punt(e, "byte displacement overflow"); + *cp = tw; + } + break; + case 1: /* 2 bytes */ + tw = *(short *)cp; + if (IS_RP_PC_REL( rp )) + doload_punt(e, "pc relative short relocation"); + tw = adjust(e, tw, rp, "(short)"); + if (e->mode == Load) { + if (tw < -32768 || tw > 32767) + doload_punt(e, "short displacement overflow"); + *(short *)cp = tw; + } + break; + case 2: /* 4 bytes */ + tw = *(long *)cp; + if (IS_RP_PC_REL( rp )) { + + /* the following kludge is taken from 4.2A's ld.c */ + + tw += rp->r_address; + tw = adjust(e, tw, rp, "(pcrel)"); + tw -= (long)cp; + } /* if IS_RP_PC_REL( rp ) */ + else + { + tw = adjust(e, tw, rp, "(word)"); + } + if (e->mode == Load) { + *(long *)cp = tw; + } + break; + default: + doload_punt(e, "unknown relocation length"); + } + return ; + } diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/doload.h andrew/overhead/class/machdep/i386_linux/doload.h *** andrew.orig/overhead/class/machdep/i386_linux/doload.h --- andrew/overhead/class/machdep/i386_linux/doload.h Mon Sep 6 19:30:46 1993 *************** *** 0 **** --- 1,41 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1991 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* + doload.h - environment for dynamic loader + + Author: John H Howard - April 9, 1987 + */ + + + + /* here is the state during a load */ + + typedef enum doload_mode_enum { + Load, /* .. loading .do file */ + List, /* .. listing .do or .o file */ + Fix /* .. converting .o to .do file */ + } doload_mode; + + struct doload_environment { + doload_mode mode; /* operating mode */ + int fd; /* input file descriptor */ + jmp_buf errorJump; /* error exit */ + int problems; /* count of problems encountered */ + struct exec header; /* header at beginning of a.out file */ + char *text; /* text segment */ + char *data; /* data segment */ + struct relocation_info *rtab; /* relocation table */ + struct nlist *symtab; /* symbol table */ + char *stringtab; /* string table */ + struct nlist *newsym; /* replacement symbol table */ + int newsymcount; /* number of new symbols */ + }; + + + extern int doload_trace; + + #define doload_extension ".do" + + extern void *(*doload() )(); diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/entry.spp andrew/overhead/class/machdep/i386_linux/entry.spp *** andrew.orig/overhead/class/machdep/i386_linux/entry.spp --- andrew/overhead/class/machdep/i386_linux/entry.spp Mon Sep 6 19:30:46 1993 *************** *** 0 **** --- 1,858 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1991 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + /* + * + * ****** + * + * PLEASE NOTE: + * + * This file is designed to be run through the C preprocessor before + * being passed to the assembler. + * + * ***** + * + * This is the code that breaks a link to_ClassEntry routines + * and sets it to the set of routines given by the information + * pointed to by the first parameter. That structure contains the + * information needed to locate a module and verify that the module + * is the correct version along with some other infomation about the + * module. + * + * Each_ClassEntry routine must provide a way to get an index indicating + * which entry was called. On the RT this is done by placing the index in + * the static data block that is passed to the procedure in R0. For other + * machines this would be done by having each entry point set a register + * to the index and then branching to the main body of this code. + * + * The main body of the code then does the following: + * -- Calls the class_Lookup procedure passing in the structure + * pointed to by the first parameter. + * -- class_Lookup returns the base address of the procedure table + * for the module. + * -- Use the index provided by the_ClassEntry to look up the routine. + * -- Reset the stack to the state it was in before the call to this code. + * -- Make any adjustments to the stack, registers, etc. to make the + * called routine think that it was called directly. + * -- Branch (NOT a subroutine jump) to the real routine. This may be + * done differently for some new machine. + * + * NOTE1: There are currently 150 entry points. This was an arbitrary choice + * and can be changed as appropriate. If it is changed, definitions + * in class.h must also be changed. + */ + + /* + * Data section. Only used here to get access to class_ErrorReturnValue. + */ + .data + .globl _class_ErrorReturnValue /* external used to get class_Lookup status */ + + + /* + * All the entry points come to this label. When they get + * here the stack is intact and EAX contains the index. + */ + .text + .globl _class_Lookup /* used to dynamically load and bind code */ + L000: + + /* + * While in this routine (after the first few instructions) the stack + * looks like this: + * + * EBP + 0x28 parm... <-- EBP points here at entry time + * EBP + 0x24 parm4 + * EBP + 0x20 parm3 + * EBP + 0x1C parm2 + * EBP + 0x08 parm1 (pointer to header) + * EBP + 0x04 return address + * EBP + 0x00 saved EBP <-- EBP during execution + * EBP - 0x04 passed parm (passed index) + * EBP - 0x08 passed parm (pointer to header) + * + */ + + /* start of code...set up stack, etc. */ + pushl %ebp + movl %esp, %ebp + + /* set up registers and call to class_Lookup */ + pushl %eax /* index */ + pushl 0x08(%ebp) /* pointer to header */ + call _class_Lookup + + /* back from class_Lookup */ + cmpl $0, %eax /* lookup failed? */ + je ErrorExit /* yes, return class_ErrorReturnValue */ + /* no, jump to the proper class routine */ + + /* non-zero value from class_Lookup is base of proc table */ + movl -0x04(%ebp), %edx /* get back index */ + movl (%eax, %edx, 4), %eax /* get routine address in %eax using the funky addr modes */ + leave /* fix up stack */ + jmp *%eax /* jump to the routine */ + + ErrorExit: + /* return the value in class_ErrorReturnValue */ + movl _class_ErrorReturnValue, %eax /* get return value in correct place */ + leave /* restore stack */ + ret /* and return to caller */ + + + /* + * and now come the entry points. + */ + .globl _ClassEntry0 + _ClassEntry0: + movl $0, %eax + jmp L000 + + .globl _ClassEntry1 + _ClassEntry1: + movl $1, %eax + jmp L000 + + .globl _ClassEntry2 + _ClassEntry2: + movl $2, %eax + jmp L000 + + .globl _ClassEntry3 + _ClassEntry3: + movl $3, %eax + jmp L000 + + .globl _ClassEntry4 + _ClassEntry4: + movl $4, %eax + jmp L000 + + .globl _ClassEntry5 + _ClassEntry5: + movl $5, %eax + jmp L000 + + .globl _ClassEntry6 + _ClassEntry6: + movl $6, %eax + jmp L000 + + .globl _ClassEntry7 + _ClassEntry7: + movl $7, %eax + jmp L000 + + .globl _ClassEntry8 + _ClassEntry8: + movl $8, %eax + jmp L000 + + .globl _ClassEntry9 + _ClassEntry9: + movl $9, %eax + jmp L000 + + .globl _ClassEntry10 + _ClassEntry10: + movl $10, %eax + jmp L000 + + .globl _ClassEntry11 + _ClassEntry11: + movl $11, %eax + jmp L000 + + .globl _ClassEntry12 + _ClassEntry12: + movl $12, %eax + jmp L000 + + .globl _ClassEntry13 + _ClassEntry13: + movl $13, %eax + jmp L000 + + .globl _ClassEntry14 + _ClassEntry14: + movl $14, %eax + jmp L000 + + .globl _ClassEntry15 + _ClassEntry15: + movl $15, %eax + jmp L000 + + .globl _ClassEntry16 + _ClassEntry16: + movl $16, %eax + jmp L000 + + .globl _ClassEntry17 + _ClassEntry17: + movl $17, %eax + jmp L000 + + .globl _ClassEntry18 + _ClassEntry18: + movl $18, %eax + jmp L000 + + .globl _ClassEntry19 + _ClassEntry19: + movl $19, %eax + jmp L000 + + .globl _ClassEntry20 + _ClassEntry20: + movl $20, %eax + jmp L000 + + .globl _ClassEntry21 + _ClassEntry21: + movl $21, %eax + jmp L000 + + .globl _ClassEntry22 + _ClassEntry22: + movl $22, %eax + jmp L000 + + .globl _ClassEntry23 + _ClassEntry23: + movl $23, %eax + jmp L000 + + .globl _ClassEntry24 + _ClassEntry24: + movl $24, %eax + jmp L000 + + .globl _ClassEntry25 + _ClassEntry25: + movl $25, %eax + jmp L000 + + .globl _ClassEntry26 + _ClassEntry26: + movl $26, %eax + jmp L000 + + .globl _ClassEntry27 + _ClassEntry27: + movl $27, %eax + jmp L000 + + .globl _ClassEntry28 + _ClassEntry28: + movl $28, %eax + jmp L000 + + .globl _ClassEntry29 + _ClassEntry29: + movl $29, %eax + jmp L000 + + .globl _ClassEntry30 + _ClassEntry30: + movl $30, %eax + jmp L000 + + .globl _ClassEntry31 + _ClassEntry31: + movl $31, %eax + jmp L000 + + .globl _ClassEntry32 + _ClassEntry32: + movl $32, %eax + jmp L000 + + .globl _ClassEntry33 + _ClassEntry33: + movl $33, %eax + jmp L000 + + .globl _ClassEntry34 + _ClassEntry34: + movl $34, %eax + jmp L000 + + .globl _ClassEntry35 + _ClassEntry35: + movl $35, %eax + jmp L000 + + .globl _ClassEntry36 + _ClassEntry36: + movl $36, %eax + jmp L000 + + .globl _ClassEntry37 + _ClassEntry37: + movl $37, %eax + jmp L000 + + .globl _ClassEntry38 + _ClassEntry38: + movl $38, %eax + jmp L000 + + .globl _ClassEntry39 + _ClassEntry39: + movl $39, %eax + jmp L000 + + .globl _ClassEntry40 + _ClassEntry40: + movl $40, %eax + jmp L000 + + .globl _ClassEntry41 + _ClassEntry41: + movl $41, %eax + jmp L000 + + .globl _ClassEntry42 + _ClassEntry42: + movl $42, %eax + jmp L000 + + .globl _ClassEntry43 + _ClassEntry43: + movl $43, %eax + jmp L000 + + .globl _ClassEntry44 + _ClassEntry44: + movl $44, %eax + jmp L000 + + .globl _ClassEntry45 + _ClassEntry45: + movl $45, %eax + jmp L000 + + .globl _ClassEntry46 + _ClassEntry46: + movl $46, %eax + jmp L000 + + .globl _ClassEntry47 + _ClassEntry47: + movl $47, %eax + jmp L000 + + .globl _ClassEntry48 + _ClassEntry48: + movl $48, %eax + jmp L000 + + .globl _ClassEntry49 + _ClassEntry49: + movl $49, %eax + jmp L000 + + .globl _ClassEntry50 + _ClassEntry50: + movl $50, %eax + jmp L000 + + .globl _ClassEntry51 + _ClassEntry51: + movl $51, %eax + jmp L000 + + .globl _ClassEntry52 + _ClassEntry52: + movl $52, %eax + jmp L000 + + .globl _ClassEntry53 + _ClassEntry53: + movl $53, %eax + jmp L000 + + .globl _ClassEntry54 + _ClassEntry54: + movl $54, %eax + jmp L000 + + .globl _ClassEntry55 + _ClassEntry55: + movl $55, %eax + jmp L000 + + .globl _ClassEntry56 + _ClassEntry56: + movl $56, %eax + jmp L000 + + .globl _ClassEntry57 + _ClassEntry57: + movl $57, %eax + jmp L000 + + .globl _ClassEntry58 + _ClassEntry58: + movl $58, %eax + jmp L000 + + .globl _ClassEntry59 + _ClassEntry59: + movl $59, %eax + jmp L000 + + .globl _ClassEntry60 + _ClassEntry60: + movl $60, %eax + jmp L000 + + .globl _ClassEntry61 + _ClassEntry61: + movl $61, %eax + jmp L000 + + .globl _ClassEntry62 + _ClassEntry62: + movl $62, %eax + jmp L000 + + .globl _ClassEntry63 + _ClassEntry63: + movl $63, %eax + jmp L000 + + .globl _ClassEntry64 + _ClassEntry64: + movl $64, %eax + jmp L000 + + .globl _ClassEntry65 + _ClassEntry65: + movl $65, %eax + jmp L000 + + .globl _ClassEntry66 + _ClassEntry66: + movl $66, %eax + jmp L000 + + .globl _ClassEntry67 + _ClassEntry67: + movl $67, %eax + jmp L000 + + .globl _ClassEntry68 + _ClassEntry68: + movl $68, %eax + jmp L000 + + .globl _ClassEntry69 + _ClassEntry69: + movl $69, %eax + jmp L000 + + .globl _ClassEntry70 + _ClassEntry70: + movl $70, %eax + jmp L000 + + .globl _ClassEntry71 + _ClassEntry71: + movl $71, %eax + jmp L000 + + .globl _ClassEntry72 + _ClassEntry72: + movl $72, %eax + jmp L000 + + .globl _ClassEntry73 + _ClassEntry73: + movl $73, %eax + jmp L000 + + .globl _ClassEntry74 + _ClassEntry74: + movl $74, %eax + jmp L000 + + .globl _ClassEntry75 + _ClassEntry75: + movl $75, %eax + jmp L000 + + .globl _ClassEntry76 + _ClassEntry76: + movl $76, %eax + jmp L000 + + .globl _ClassEntry77 + _ClassEntry77: + movl $77, %eax + jmp L000 + + .globl _ClassEntry78 + _ClassEntry78: + movl $78, %eax + jmp L000 + + .globl _ClassEntry79 + _ClassEntry79: + movl $79, %eax + jmp L000 + + .globl _ClassEntry80 + _ClassEntry80: + movl $80, %eax + jmp L000 + + .globl _ClassEntry81 + _ClassEntry81: + movl $81, %eax + jmp L000 + + .globl _ClassEntry82 + _ClassEntry82: + movl $82, %eax + jmp L000 + + .globl _ClassEntry83 + _ClassEntry83: + movl $83, %eax + jmp L000 + + .globl _ClassEntry84 + _ClassEntry84: + movl $84, %eax + jmp L000 + + .globl _ClassEntry85 + _ClassEntry85: + movl $85, %eax + jmp L000 + + .globl _ClassEntry86 + _ClassEntry86: + movl $86, %eax + jmp L000 + + .globl _ClassEntry87 + _ClassEntry87: + movl $87, %eax + jmp L000 + + .globl _ClassEntry88 + _ClassEntry88: + movl $88, %eax + jmp L000 + + .globl _ClassEntry89 + _ClassEntry89: + movl $89, %eax + jmp L000 + + .globl _ClassEntry90 + _ClassEntry90: + movl $90, %eax + jmp L000 + + .globl _ClassEntry91 + _ClassEntry91: + movl $91, %eax + jmp L000 + + .globl _ClassEntry92 + _ClassEntry92: + movl $92, %eax + jmp L000 + + .globl _ClassEntry93 + _ClassEntry93: + movl $93, %eax + jmp L000 + + .globl _ClassEntry94 + _ClassEntry94: + movl $94, %eax + jmp L000 + + .globl _ClassEntry95 + _ClassEntry95: + movl $95, %eax + jmp L000 + + .globl _ClassEntry96 + _ClassEntry96: + movl $96, %eax + jmp L000 + + .globl _ClassEntry97 + _ClassEntry97: + movl $97, %eax + jmp L000 + + .globl _ClassEntry98 + _ClassEntry98: + movl $98, %eax + jmp L000 + + .globl _ClassEntry99 + _ClassEntry99: + movl $99, %eax + jmp L000 + + .globl _ClassEntry100 + _ClassEntry100: + movl $100, %eax + jmp L000 + + .globl _ClassEntry101 + _ClassEntry101: + movl $101, %eax + jmp L000 + + .globl _ClassEntry102 + _ClassEntry102: + movl $102, %eax + jmp L000 + + .globl _ClassEntry103 + _ClassEntry103: + movl $103, %eax + jmp L000 + + .globl _ClassEntry104 + _ClassEntry104: + movl $104, %eax + jmp L000 + + .globl _ClassEntry105 + _ClassEntry105: + movl $105, %eax + jmp L000 + + .globl _ClassEntry106 + _ClassEntry106: + movl $106, %eax + jmp L000 + + .globl _ClassEntry107 + _ClassEntry107: + movl $107, %eax + jmp L000 + + .globl _ClassEntry108 + _ClassEntry108: + movl $108, %eax + jmp L000 + + .globl _ClassEntry109 + _ClassEntry109: + movl $109, %eax + jmp L000 + + .globl _ClassEntry110 + _ClassEntry110: + movl $110, %eax + jmp L000 + + .globl _ClassEntry111 + _ClassEntry111: + movl $111, %eax + jmp L000 + + .globl _ClassEntry112 + _ClassEntry112: + movl $112, %eax + jmp L000 + + .globl _ClassEntry113 + _ClassEntry113: + movl $113, %eax + jmp L000 + + .globl _ClassEntry114 + _ClassEntry114: + movl $114, %eax + jmp L000 + + .globl _ClassEntry115 + _ClassEntry115: + movl $115, %eax + jmp L000 + + .globl _ClassEntry116 + _ClassEntry116: + movl $116, %eax + jmp L000 + + .globl _ClassEntry117 + _ClassEntry117: + movl $117, %eax + jmp L000 + + .globl _ClassEntry118 + _ClassEntry118: + movl $118, %eax + jmp L000 + + .globl _ClassEntry119 + _ClassEntry119: + movl $119, %eax + jmp L000 + + .globl _ClassEntry120 + _ClassEntry120: + movl $120, %eax + jmp L000 + + .globl _ClassEntry121 + _ClassEntry121: + movl $121, %eax + jmp L000 + + .globl _ClassEntry122 + _ClassEntry122: + movl $122, %eax + jmp L000 + + .globl _ClassEntry123 + _ClassEntry123: + movl $123, %eax + jmp L000 + + .globl _ClassEntry124 + _ClassEntry124: + movl $124, %eax + jmp L000 + + .globl _ClassEntry125 + _ClassEntry125: + movl $125, %eax + jmp L000 + + .globl _ClassEntry126 + _ClassEntry126: + movl $126, %eax + jmp L000 + + .globl _ClassEntry127 + _ClassEntry127: + movl $127, %eax + jmp L000 + + .globl _ClassEntry128 + _ClassEntry128: + movl $128, %eax + jmp L000 + + .globl _ClassEntry129 + _ClassEntry129: + movl $129, %eax + jmp L000 + + .globl _ClassEntry130 + _ClassEntry130: + movl $130, %eax + jmp L000 + + .globl _ClassEntry131 + _ClassEntry131: + movl $131, %eax + jmp L000 + + .globl _ClassEntry132 + _ClassEntry132: + movl $132, %eax + jmp L000 + + .globl _ClassEntry133 + _ClassEntry133: + movl $133, %eax + jmp L000 + + .globl _ClassEntry134 + _ClassEntry134: + movl $134, %eax + jmp L000 + + .globl _ClassEntry135 + _ClassEntry135: + movl $135, %eax + jmp L000 + + .globl _ClassEntry136 + _ClassEntry136: + movl $136, %eax + jmp L000 + + .globl _ClassEntry137 + _ClassEntry137: + movl $137, %eax + jmp L000 + + .globl _ClassEntry138 + _ClassEntry138: + movl $138, %eax + jmp L000 + + .globl _ClassEntry139 + _ClassEntry139: + movl $139, %eax + jmp L000 + + .globl _ClassEntry140 + _ClassEntry140: + movl $140, %eax + jmp L000 + + .globl _ClassEntry141 + _ClassEntry141: + movl $141, %eax + jmp L000 + + .globl _ClassEntry142 + _ClassEntry142: + movl $142, %eax + jmp L000 + + .globl _ClassEntry143 + _ClassEntry143: + movl $143, %eax + jmp L000 + + .globl _ClassEntry144 + _ClassEntry144: + movl $144, %eax + jmp L000 + + .globl _ClassEntry145 + _ClassEntry145: + movl $145, %eax + jmp L000 + + .globl _ClassEntry146 + _ClassEntry146: + movl $146, %eax + jmp L000 + + .globl _ClassEntry147 + _ClassEntry147: + movl $147, %eax + jmp L000 + + .globl _ClassEntry148 + _ClassEntry148: + movl $148, %eax + jmp L000 + + .globl _ClassEntry149 + _ClassEntry149: + movl $149, %eax + jmp L000 + + diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/getlist.awk andrew/overhead/class/machdep/i386_linux/getlist.awk *** andrew.orig/overhead/class/machdep/i386_linux/getlist.awk --- andrew/overhead/class/machdep/i386_linux/getlist.awk Mon Sep 6 19:30:46 1993 *************** *** 0 **** --- 1,173 ---- + ## ###################################################################### ## + ## Copyright IBM Corporation 1988,1991 - All Rights Reserved ## + ## For full copyright information see:'andrew/config/COPYRITE' ## + ## ###################################################################### ## + + # awk script to list all modules and entry points from a library which are + # needed (via transitive closure) for a given list of basic entry points + + # the input to this awk script should be generated by: nm -go /lib/libc.a | tr : " " + + # data structures used here: + # + # definer[entry-point-name] = module-name + # library[entry-point-name] = library-name + # epcount = # entry-point-name's seen so far + # ep[k] = k'th entry-point-name + # refcount[entry-point-name] = number of references by wanted modules + # referrer[entry-point-name.k] = k'th module-name with an undefined reference to this entry-point-name + # want[module-name] = "Y" if this module wanted + + # search output of nm and set up definers and referrers + + / [ATDBC] / { + if (definer[$5] == "") { + definer[ep[epcount++] = $5] = $2; + library[$5] = $1; + } + } + + / U / { + referrer[$4 "." refcount[$4]++] = $1 "." $2; + } + + # postprocessing + + END { + + + # Specify which entry points we definitely want. Edit this list to add entry points. + + want[library["_class_RoutineStruct"] "." definer["_class_RoutineStruct"]] = "Y"; + want[library["_class_Error"] "." definer["_class_Error"]] = "Y"; + want[library["_ProgramName"] "." definer["_ProgramName"]] = "Y"; + # want[library["_class_Header"] "." definer["_class_Header"]] = "Y"; + want[library["_class_NewObject"] "." definer["_class_NewObject"]] = "Y"; + want[library["_class_Load"] "." definer["_class_Load"]] = "Y"; + want[library["_class_IsLoaded"] "." definer["_class_IsLoaded"]] = "Y"; + want[library["_class_Lookup"] "." definer["_class_Lookup"]] = "Y"; + want[library["_class_IsType"] "." definer["_class_IsType"]] = "Y"; + want[library["_class_IsTypeByName"] "." definer["_class_IsTypeByName"]] = "Y"; + want[library["_class_EnterInfo"] "." definer["_class_EnterInfo"]] = "Y"; + want[library["_class_SetClassPath"] "." definer["_class_SetClassPath"]] = "Y"; + want[library["_class_PrependClassPath"] "." definer["_class_PrependClassPath"]] = "Y"; + want[library["_class_GetEText"] "." definer["_class_GetEText"]] = "Y"; + want[library["_environ"] "." definer["_environ"]] = "Y"; + want[library["__exit"] "." definer["__exit"]] = "Y"; + want[library["_abort"] "." definer["_abort"]] = "Y"; + want[library["_alloca"] "." definer["_alloca"]] = "Y"; + want[library["_blt"] "." definer["_blt"]] = "Y"; + want[library["_bcopy"] "." definer["_bcopy"]] = "Y"; + want[library["_brk"] "." definer["_brk"]] = "Y"; + want[library["_bzero"] "." definer["_bzero"]] = "Y"; + want[library["_calloc"] "." definer["_calloc"]] = "Y"; + want[library["_cfree"] "." definer["_cfree"]] = "Y"; + want[library["_errno"] "." definer["_errno"]] = "Y"; + want[library["_close"] "." definer["_close"]] = "Y"; + want[library["_errno"] "." definer["_errno"]] = "Y"; + want[library["_creat"] "." definer["_creat"]] = "Y"; + want[library["__ctype_"] "." definer["__ctype_"]] = "Y"; + want[library["__doprnt"] "." definer["__doprnt"]] = "Y"; + want[library["_ecvt"] "." definer["_ecvt"]] = "Y"; + want[library["_fcvt"] "." definer["_fcvt"]] = "Y"; + want[library["_sys_errlist"] "." definer["_sys_errlist"]] = "Y"; + want[library["_sys_nerr"] "." definer["_sys_nerr"]] = "Y"; + want[library["_exit"] "." definer["_exit"]] = "Y"; + want[library["_fcntl"] "." definer["_fcntl"]] = "Y"; + want[library["__filbuf"] "." definer["__filbuf"]] = "Y"; + want[library["__iob"] "." definer["__iob"]] = "Y"; + want[library["__cleanup"] "." definer["__cleanup"]] = "Y"; + want[library["__flsbuf"] "." definer["__flsbuf"]] = "Y"; + want[library["_fclose"] "." definer["_fclose"]] = "Y"; + want[library["_fflush"] "." definer["_fflush"]] = "Y"; + want[library["_fopen"] "." definer["_fopen"]] = "Y"; + want[library["_fprintf"] "." definer["_fprintf"]] = "Y"; + want[library["_fread"] "." definer["_fread"]] = "Y"; + want[library["_fstat"] "." definer["_fstat"]] = "Y"; + want[library["_fwrite"] "." definer["_fwrite"]] = "Y"; + want[library["_gcvt"] "." definer["_gcvt"]] = "Y"; + want[library["_getdtablesize"] "." definer["_getdtablesize"]] = "Y"; + want[library["_getpagesize"] "." definer["_getpagesize"]] = "Y"; + want[library["_ioctl"] "." definer["_ioctl"]] = "Y"; + want[library["_isatty"] "." definer["_isatty"]] = "Y"; + want[library["_lseek"] "." definer["_lseek"]] = "Y"; + want[library["_malloc"] "." definer["_malloc"]] = "Y"; + want[library["_modf"] "." definer["_modf"]] = "Y"; + want[library["_realloc"] "." definer["_realloc"]] = "Y"; + want[library["_free"] "." definer["_free"]] = "Y"; + want[library["_open"] "." definer["_open"]] = "Y"; + want[library["_perror"] "." definer["_perror"]] = "Y"; + want[library["_printf"] "." definer["_printf"]] = "Y"; + want[library["_read"] "." definer["_read"]] = "Y"; + want[library["_sbrk"] "." definer["_sbrk"]] = "Y"; + want[library["curbrk"] "." definer["curbrk"]] = "Y"; + want[library["_sigvec"] "." definer["_sigvec"]] = "Y"; + want[library["_sprintf"] "." definer["_sprintf"]] = "Y"; + want[library["_strlen"] "." definer["_strlen"]] = "Y"; + want[library["_syscall"] "." definer["_syscall"]] = "Y"; + want[library["_write"] "." definer["_write"]] = "Y"; + want[library["_writev"] "." definer["_writev"]] = "Y"; + + want[library["_gethostbyname"] "." definer["_gethostbyname"]] = "Y"; + want[library["_gethostbyaddr"] "." definer["_gethostbyaddr"]] = "Y"; + want[library["_sethostent"] "." definer["_sethostent"]] = "Y"; + want[library["_res_querydomain"] "." definer["_res_querydomain"]] = "Y"; + want[library["_res_mkquery"] "." definer["_res_mkquery"]] = "Y"; + want[library["_res_send"] "." definer["_res_send"]] = "Y"; + want[library["_dn_expand"] "." definer["_dn_expand"]] = "Y"; + want[library["_res_init"] "." definer["_res_init"]] = "Y"; + want[library["__endhtent"] "." definer["__endhtent"]] = "Y"; + want[library["__sethtent"] "." definer["__sethtent"]] = "Y"; + want[library["__gethtbyaddr"] "." definer["__gethtbyaddr"]] = "Y"; + want[library["__gethtbyname"] "." definer["__gethtbyname"]] = "Y"; + want[library["__gethtent"] "." definer["__gethtent"]] = "Y"; + want[library["__getrhbyaddr"] "." definer["__getrhbyaddr"]] = "Y"; + want[library["_endhostent"] "." definer["_endhostent"]] = "Y"; + want[library["_sethostfile"] "." definer["_sethostfile"]] = "Y"; + want[library["_hostalias"] "." definer["_hostalias"]] = "Y"; + want[library["_res_query"] "." definer["_res_query"]] = "Y"; + want[library["_res_search"] "." definer["_res_search"]] = "Y"; + want[library["__res_close"] "." definer["__res_close"]] = "Y"; + want[library["_fp_query"] "." definer["_fp_query"]] = "Y"; + want[library["_p_cdname"] "." definer["_p_cdname"]] = "Y"; + want[library["_p_class"] "." definer["_p_class"]] = "Y"; + want[library["_p_query"] "." definer["_p_query"]] = "Y"; + want[library["_p_rr"] "." definer["_p_rr"]] = "Y"; + want[library["_p_type"] "." definer["_p_type"]] = "Y"; + want[library["__getlong"] "." definer["__getlong"]] = "Y"; + want[library["__getshort"] "." definer["__getshort"]] = "Y"; + want[library["_dn_comp"] "." definer["_dn_comp"]] = "Y"; + want[library["_dn_skipname"] "." definer["_dn_skipname"]] = "Y"; + want[library["_putlong"] "." definer["_putlong"]] = "Y"; + want[library["_putshort"] "." definer["_putshort"]] = "Y"; + want[library["_strcasecmp"] "." definer["_strcasecmp"]] = "Y"; + want[library["_strncasecmp"] "." definer["_strncasecmp"]] = "Y"; + want[library["__res_opcodes"] "." definer["__res_opcodes"]] = "Y"; + want[library["__res_resultcodes"] "." definer["__res_resultcodes"]] = "Y"; + want[library["__res"] "." definer["__res"]] = "Y"; + want[library["_h_errno"] "." definer["_h_errno"]] = "Y"; + + # now take transitive closure of wanted modules + + for (needmore = "Y"; needmore == "Y"; ) { + needmore = "N"; + for ( i = 0; i < epcount; i++) { + if (want[library[ep[i]] "." definer[ep[i]]] != "Y") { + want[library[ep[i]] "." definer[ep[i]]] = "N"; + for ( j = 0; j < refcount[ep[i]]; j++ ) { + if (want[referrer[ep[i] "." j]] == "Y") { + want[library[ep[i]] "." definer[ep[i]]] = "Y"; + needmore = "Y"; + break; + } + } + } + } + } + + # write out all wanted module name and entry points + + for ( i = 0 ; i < epcount ; i++) + if (want[library[ep[i]] "." definer[ep[i]]] == "Y") + printf "%s %s\n", definer[ep[i]], ep[i]; + } diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/globals.spp andrew/overhead/class/machdep/i386_linux/globals.spp *** andrew.orig/overhead/class/machdep/i386_linux/globals.spp --- andrew/overhead/class/machdep/i386_linux/globals.spp Mon Sep 6 19:30:46 1993 *************** *** 0 **** --- 1,77 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1991 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + /* + * array of global entry points for dynamic loader + * + * Defines a table of entry points and their names + * + */ + + .text + + /* macros which actually define entry points */ + + /* globalref - direct reference to global symbol x */ + + #ifdef __STDC__ + #define globalref(x) .globl x ; \ + .set _X_, _X_+1; \ + .text; .long x,1f; .data;1: .asciz #x + #else + #define globalref(x) .globl x ; \ + .set _X_, _X_+1; \ + .text; .long x,1f; .data;1: .asciz "x" + #endif + + /* routine - reference to routine x - _x */ + + #ifdef __STDC__ + #define routine(x) globalref(_ ## x) + #else + #define routine(x) globalref(_/**/x) + #endif + + .globl _globals + .globl _globalcount + .set _X_, 0 + + _globals: /* beginning of entry point table */ + + /* from libclass */ + globalref(_main) /* hacked to allow functionality of atk/basics */ + globalref(_class_RoutineStruct) + globalref(_class_Error) + routine(class_NewObject) + routine(class_Load) + routine(class_IsLoaded) + routine(class_Lookup) + routine(class_IsType) + routine(class_IsTypeByName) + routine(class_EnterInfo) + routine(class_SetClassPath) + routine(class_PrependClassPath) + routine(class_GetEText) + routine(class_GetTextBase) + routine(class_GetTextLength) + + + /* common symbols referred to but not defined directly in libc.a */ + + globalref(_environ) /* common symbol, defined nowhere */ + globalref(_errno) /* cerror */ + /* do not delete the following line - make depends on it */ + + #include <globalrefs._h> + + .text + + _globalcount: + .long _X_ + + /* special cases for missing entry points under various machine types */ + + /* end of globals.s */ + diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/makedo.csh andrew/overhead/class/machdep/i386_linux/makedo.csh *** andrew.orig/overhead/class/machdep/i386_linux/makedo.csh --- andrew/overhead/class/machdep/i386_linux/makedo.csh Mon Sep 6 20:53:56 1993 *************** *** 0 **** --- 1,94 ---- + #!/bin/csh -f + ## ###################################################################### ## + ## Copyright IBM Corporation 1988,1991 - All Rights Reserved ## + ## For full copyright information see:'andrew/config/COPYRITE' ## + ## ###################################################################### ## + + # Script to convert normal object files into a dynamically loadable module. + + if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew + if ($#argv == 0) then + echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." + echo " -b overrides /usr/andrew/bin for finding dofix, doindex" + echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" + echo " -e overrides the default entry point" + echo " -g causes .dog file to be generated for debugger use" + exit 1 + endif + set filelist + set bindir="${ANDREWDIR}/bin" + set libdir="${ANDREWDIR}/lib" + foreach file ($*) + if ($?outcoming) then + set outfile=$file + unset outcoming + continue + endif + if ($?bincoming) then + set bindir=$file + unset bincoming + continue + endif + if ($?libcoming) then + set libdir=$file + unset libcoming + continue + endif + if ($?entrypointcoming) then + set entrypoint=$file + unset entrypointcoming + continue + endif + switch ($file) + case -o: + set outcoming + breaksw + case -b: + set bincoming + breaksw + case -d: + set libcoming + breaksw + case -e: + set entrypointcoming + breaksw + case -g: + set gflag + breaksw + default: + if (! $?outfile) set outfile=$file + set filelist=($filelist $file) + endsw + end + if ($?outcoming) then + echo "makedo: missing argument to -o switch." + exit 1 + endif + if ($?bincoming) then + echo "makedo: missing argument to -b switch." + exit 1 + endif + if ($?libcoming) then + echo "makedo: missing argument to -d switch." + exit 1 + endif + if ($?entrypointcoming) then + echo "makedo: missing argument to -e switch." + exit 1 + endif + if (! $?filelist) then + echo "makedo: No object modules given." + exit 1 + endif + if (! $?entrypoint) then + set entrypoint=_${outfile:r}__GetClassInfo + endif + ld -r -o ${outfile:r}.dog $filelist ${libdir}/libcx.a | egrep "ld:" + ${bindir}/dofix -e $entrypoint ${outfile:r}.dog + set retcode=$status + if (! $?gflag) rm ${outfile:r}.dog + if (! $retcode) then + ${bindir}/doindex ${outfile:r}.do + set retcode=$status + endif + exit($retcode) diff -cr --new-file andrew.orig/overhead/class/pp/class.c andrew/overhead/class/pp/class.c *** andrew.orig/overhead/class/pp/class.c Sat Jan 25 04:06:51 1992 --- andrew/overhead/class/pp/class.c Sat Sep 4 11:54:08 1993 *************** *** 13,18 **** --- 13,21 ---- #include <ctype.h> #include <signal.h> + #ifdef linux + #include <bsd/signal.h> + #endif /* * define these for the compiler */ *************** *** 20,26 **** char *malloc(),*realloc(); /* should include stdlib.h */ #endif /* _IBMR2 */ extern int yylex(); /* using lex */ ! extern char yytext[]; /* --- 23,33 ---- char *malloc(),*realloc(); /* should include stdlib.h */ #endif /* _IBMR2 */ extern int yylex(); /* using lex */ ! #ifdef linux ! extern char * yytext; ! #else ! extern char yytext[]; ! #endif /* diff -cr --new-file andrew.orig/overhead/class/pp/classpp.l andrew/overhead/class/pp/classpp.l *** andrew.orig/overhead/class/pp/classpp.l Fri Jan 24 04:23:14 1992 --- andrew/overhead/class/pp/classpp.l Sat Sep 4 13:15:03 1993 *************** *** 2,7 **** --- 2,19 ---- #include <classpp.h> extern int nametype; /* pass back info to class preprocessor */ extern void errorexit(); /* what to do if something bad happens */ + #ifdef FLEX_SCANNER + #define MINUS_ONE ({yyless(2); nametype=name_MinusOne;class_Name;}) + /* This is GCC specific. The ({..}) is */ + /* a gcc extension. However, the only */ + /* place that uses flex at the moment */ + /* is linux, so we'll call it */ + /* acceptable. */ + #define class_TokUnput(a) ({ yyless(yyleng-1); (a); }) + #define class_TokName(a) ({ yyless(yyleng-1);nametype=(a); class_Name; }) + #else + #define MINUS_ONE (class_TokMinusOne()) + #endif %} %% class[^A-Z0-9a-z_] return(class_TokUnput(class_Class)); *************** *** 37,47 **** pointer[^A-Z0-9a-z_] return(class_TokName(name_Pointer)); boolean[^A-Z0-9a-z_] return(class_TokName(name_Boolean)); NULL[^A-Z0-9a-z_] return(class_TokName(name_NULL)); ! -1[^0-9] return(class_TokName(name_MinusOne)); /* wrong, but convenient */ exit[^A-Z0-9a-z_] return(class_TokName(name_Exit)); ! \/\* return(class_TokComment()); ! \" return(class_TokString()); ";" return(class_Semi); "," return(class_Comma); --- 49,59 ---- pointer[^A-Z0-9a-z_] return(class_TokName(name_Pointer)); boolean[^A-Z0-9a-z_] return(class_TokName(name_Boolean)); NULL[^A-Z0-9a-z_] return(class_TokName(name_NULL)); ! -1[^0-9] return MINUS_ONE; /* wrong, but convenient */ exit[^A-Z0-9a-z_] return(class_TokName(name_Exit)); ! "/*"([^*]|"*"+[^*/])*"*"+"/" return(class_Comment); ! \"("\".|[^"])\" return(class_String); ";" return(class_Semi); "," return(class_Comma); *************** *** 63,68 **** --- 75,81 ---- #undef YYLMAX #define YYLMAX 1000 + #ifndef FLEX_SCANNER class_TokUnput(tok) short tok; { *************** *** 78,83 **** --- 91,102 ---- return class_TokUnput(class_Name); } + class_TokMinusOne() + { + return class_TokName(name_MinusOne); + } + #endif + class_TokWhitespace() { /* convert an escaped newline into a space */ *************** *** 89,137 **** return (class_WhiteSpace); } - class_TokComment(str) - char *str; { - /* must search to the end of the comment */ - /* attempt to return it in str - up to the point that fits */ - - int i = 2, c, SawStar = 0; - - yytext[YYLMAX-3] = '*'; - yytext[YYLMAX-2] = '/'; - yytext[YYLMAX-1] = '\0'; - - while ((c = input()) > 0) { - if (i < YYLMAX - 3) yytext[i] = c; - i += 1; - if (SawStar && c == '/') break; - SawStar = (c == '*'); - } - if (i < (YYLMAX - 3)) yytext[i] = '\0'; - return (class_Comment); - } - - class_TokString(str) - char *str; { - int i = 1, c, SawBackSlash = 0; - - yytext[YYLMAX-2] = '"'; - yytext[YYLMAX-1] = '0'; - - while ((c = input()) > 0) { - if (i < YYLMAX - 2) yytext[i] = c; - i += 1; - if (! SawBackSlash && c == '"') break; - SawBackSlash = (c == '\\'); - } - if (i < (YYLMAX - 2)) yytext[i] = '\0'; - if (i > (YYLMAX - 2)) { - fprintf(stderr, "String Constant too long - truncated\n"); - } - return (class_String); - } static int FilePtr = 0; static FILE *FileStack[FILESTACKSIZE]; void PushFile(file) --- 108,118 ---- return (class_WhiteSpace); } static int FilePtr = 0; + + #ifndef FLEX_SCANNER static FILE *FileStack[FILESTACKSIZE]; void PushFile(file) *************** *** 154,160 **** --- 135,166 ---- yyin = FileStack[FilePtr-1]; } } + #else /* flex scanner. */ + static YY_BUFFER_STATE FileStack[FILESTACKSIZE]; + + void PushFile(file) + FILE *file; { + if (FilePtr >= FILESTACKSIZE) { + errorexit(EXITCODE_BUG, "PushFile stack is full!"); + } + yy_switch_to_buffer(yy_create_buffer(file, YY_BUF_SIZE)); + FileStack[FilePtr] = YY_CURRENT_BUFFER; + FilePtr += 1; + } + void PopFile() { + YY_BUFFER_STATE now = YY_CURRENT_BUFFER; + fclose(yyin); + if (FilePtr < 1) { + errorexit(EXITCODE_BUG, "PopFile stack is empty!"); + } + FilePtr -=1; + if (FilePtr > 0) { + yy_switch_to_buffer(FileStack[FilePtr-1]); + yy_delete_buffer(now); + } + } + #endif /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1991 - All Rights Reserved * *************** *** 161,164 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/class/pp/RCS/classpp.l,v 2.4 1991/09/17 19:20:27 susan Exp $ */ \ No newline at end of file --- 167,170 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/class/pp/RCS/classpp.l,v 2.4 1991/09/17 19:20:27 susan Exp $ */ diff -cr --new-file andrew.orig/overhead/eli/lib/elil.l andrew/overhead/eli/lib/elil.l *** andrew.orig/overhead/eli/lib/elil.l Fri Jan 24 04:24:29 1992 --- andrew/overhead/eli/lib/elil.l Sat Sep 4 11:59:04 1993 *************** *** 1,6 **** --- 1,9 ---- /* See end for RCS and copyright info */ %{ + #ifdef FLEX_SCANNER + #undef yywrap + #endif #include <eli.h> #include <eliy.h> *************** *** 66,87 **** ******************************************************************/ static char *elil_rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/elil.l,v 2.9 1991/09/13 16:47:10 bobg Exp $"; ! #undef input ! static int input() /* Replaces the lex macro */ { int result; ! switch (EliProcessInfo.u_source) { /* Where is the input coming from? */ case e_source_stdin: ! result = ((yytchar = yysptr > yysbuf ? ! U(*--yysptr) : getc(yyin)) == 10 ? ! (yylineno++, yytchar) : yytchar) == EOF ? ! 0 : yytchar; ! /* ! * This ugly expression is what comes with lex ! */ break; case e_source_string: result = (int) *(EliProcessInfo.u_sourcestring++); /* No need to test for --- 69,89 ---- ******************************************************************/ static char *elil_rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/elil.l,v 2.9 1991/09/13 16:47:10 bobg Exp $"; + #ifdef FLEX_SCANNER ! #else ! #undef YY_INPUT ! #define YY_INPUT(buf, result, max_size) ((result) =my_input((buf), (max_size))) ! static int my_input(char *buf, int max_size) { int result; ! switch (EliProcessInfo.u_source) { /* Where is the input coming from? */ case e_source_stdin: ! result = input(); ! if (!result) ! return 0; break; case e_source_string: result = (int) *(EliProcessInfo.u_sourcestring++); /* No need to test for *************** *** 99,108 **** result = 0; break; } ! return (result); } #undef unput static unput(c) /* Replaces the lex macro */ --- 101,113 ---- result = 0; break; } ! if (!result) return 0 ; ! return 1; } + #endif + #ifndef FLEX_SCANNER #undef unput static unput(c) /* Replaces the lex macro */ *************** *** 124,129 **** --- 129,135 ---- break; } } + #endif static void AddToYParseBuf(c, grow) int c, grow; diff -cr --new-file andrew.orig/overhead/eli/lib/prims1.c andrew/overhead/eli/lib/prims1.c *** andrew.orig/overhead/eli/lib/prims1.c Fri Jan 24 04:24:40 1992 --- andrew/overhead/eli/lib/prims1.c Sat Sep 4 12:06:50 1993 *************** *** 13,19 **** #include <prmtives.h> #include <sys/errno.h> ! static struct { char *name; void (*fn) (); --- 13,21 ---- #include <prmtives.h> #include <sys/errno.h> ! #ifdef linux ! #include <sys/wait.h> ! #endif static struct { char *name; void (*fn) (); *************** *** 1970,1976 **** EliStr_t *resultstrs[2]; struct itimerval itimer, olditimer; ! #if defined(SGI_4D_ENV) setpgrp(); #else setpgrp(childpid, childpid); --- 1972,1978 ---- EliStr_t *resultstrs[2]; struct itimerval itimer, olditimer; ! #if defined(SGI_4D_ENV) || defined(linux) setpgrp(); #else setpgrp(childpid, childpid); *************** *** 2416,2423 **** } free(stderrstr); EliSexp_SetInt(st, resultnodes[0], ! ((int) waitstat.w_T.w_Retcode) ! + (((int) waitstat.w_T.w_Coredump) << 8)); EliSexp_SetStr(st, resultnodes[1], resultstrs[0]); EliSexp_SetStr(st, resultnodes[2], resultstrs[1]); if (!(reslist = EliAddToList(st, reslist, resultnodes[0]))) --- 2418,2425 ---- } free(stderrstr); EliSexp_SetInt(st, resultnodes[0], ! ((int) WEXITSTATUS(waitstat)) ! + (((int) WCOREDUMP(waitstat)) << 8)); EliSexp_SetStr(st, resultnodes[1], resultstrs[0]); EliSexp_SetStr(st, resultnodes[2], resultstrs[1]); if (!(reslist = EliAddToList(st, reslist, resultnodes[0]))) diff -cr --new-file andrew.orig/overhead/index/index.c andrew/overhead/index/index.c *** andrew.orig/overhead/index/index.c Fri Jan 24 04:27:49 1992 --- andrew/overhead/index/index.c Sat Sep 4 11:07:58 1993 *************** *** 11,17 **** #endif /* lint */ #include <andrewos.h> /* sys/types.h sys/file.h */ ! #ifdef M_UNIX #include <dirent.h> #define direct dirent #else --- 11,17 ---- #endif /* lint */ #include <andrewos.h> /* sys/types.h sys/file.h */ ! #if defined(M_UNIX) || defined(linux) #include <dirent.h> #define direct dirent #else diff -cr --new-file andrew.orig/overhead/index/indexio.c andrew/overhead/index/indexio.c *** andrew.orig/overhead/index/indexio.c Fri Jan 24 04:27:51 1992 --- andrew/overhead/index/indexio.c Sat Sep 4 11:08:11 1993 *************** *** 11,17 **** #endif /* lint */ #include <andrewos.h> /* sys/types.h sys/file.h */ ! #ifdef M_UNIX #include <dirent.h> #define direct dirent #else --- 11,17 ---- #endif /* lint */ #include <andrewos.h> /* sys/types.h sys/file.h */ ! #if defined(M_UNIX) || defined(linux) #include <dirent.h> #define direct dirent #else diff -cr --new-file andrew.orig/overhead/mail/lib/parsel.l andrew/overhead/mail/lib/parsel.l *** andrew.orig/overhead/mail/lib/parsel.l Fri Jan 24 04:28:22 1992 --- andrew/overhead/mail/lib/parsel.l Sat Sep 4 12:01:59 1993 *************** *** 42,50 **** YYSTYPE yylval; ! #ifndef hp9000s300 extern char yytext[]; #endif static char *CurrentLine, *CurrentChar, *cbuffer; --- 42,54 ---- YYSTYPE yylval; ! #if !defined(hp9000s300) ! #ifdef linux ! extern char * yytext; ! #else extern char yytext[]; #endif + #endif static char *CurrentLine, *CurrentChar, *cbuffer; *************** *** 62,68 **** yycomments = NIL; ParseErrorReason = PA_SYNTAX_ERROR; } ! #undef input static char input() { --- 66,72 ---- yycomments = NIL; ParseErrorReason = PA_SYNTAX_ERROR; } ! #ifndef FLEX_SCANNER #undef input static char input() { *************** *** 83,92 **** --- 87,114 ---- if (CurrentChar > CurrentLine) *--CurrentChar = c; } + #else + #undef YY_INPUT + #define YY_INPUT(buf, result, max_size) (result = my_input(buf, max_size)) + static int my_input(char *buf, int max_size) + { + register char c; + + *buf = c = *CurrentChar++; + if ((c & 0x80) || c == 04) /* High-order bit is on, or it's a ^D */ + *buf = 1; + if (!(*buf)) return 0; + return 1; + } + #endif + #undef YYLMAX #define YYLMAX 400 + #ifdef FLEX_SCANNER + #undef yywrap + #endif int yywrap() { return 1; diff -cr --new-file andrew.orig/overhead/mail/lib/qmail.c andrew/overhead/mail/lib/qmail.c *** andrew.orig/overhead/mail/lib/qmail.c Fri Jan 24 04:28:15 1992 --- andrew/overhead/mail/lib/qmail.c Sat Sep 4 11:16:11 1993 *************** *** 119,125 **** #include <stdio.h> #include <sys/param.h> #include <fdplumb.h> ! #ifdef M_UNIX #include <dirent.h> #define direct dirent #define namlen(d) (strlen((d)->d_name)) --- 119,125 ---- #include <stdio.h> #include <sys/param.h> #include <fdplumb.h> ! #if defined(M_UNIX) || defined(linux) #include <dirent.h> #define direct dirent #define namlen(d) (strlen((d)->d_name)) diff -cr --new-file andrew.orig/overhead/mail/lib/stats.c andrew/overhead/mail/lib/stats.c *** andrew.orig/overhead/mail/lib/stats.c Fri Jan 24 04:28:25 1992 --- andrew/overhead/mail/lib/stats.c Sat Sep 4 12:06:51 1993 *************** *** 335,341 **** /* Format system info */ Format(ModuleName, module, LOGSTRLEN); ! #ifdef SGI_4D_ENV sprintf(buffer, "%04d-%02d-%02d %02d:%02d:%02d.%02d %s %10d %6d %6d %s %5d %11d %s; ", now->tm_year+1900, now->tm_mon+1, now->tm_mday, --- 335,341 ---- /* Format system info */ Format(ModuleName, module, LOGSTRLEN); ! #if defined(SGI_4D_ENV) || defined(linux) sprintf(buffer, "%04d-%02d-%02d %02d:%02d:%02d.%02d %s %10d %6d %6d %s %5d %11d %s; ", now->tm_year+1900, now->tm_mon+1, now->tm_mday, diff -cr --new-file andrew.orig/overhead/parsec/tokens.l andrew/overhead/parsec/tokens.l *** andrew.orig/overhead/parsec/tokens.l Fri Jan 24 04:28:57 1992 --- andrew/overhead/parsec/tokens.l Sat Sep 4 12:02:45 1993 *************** *** 23,29 **** #define yylex PC_NextToken extern int PC_IsTypedef(), PC_IsEnumerator(); ! static int yywrap() { return(1); --- 23,31 ---- #define yylex PC_NextToken extern int PC_IsTypedef(), PC_IsEnumerator(); ! #ifdef FLEX_SCANNER ! #undef yywrap ! #endif static int yywrap() { return(1); diff -cr --new-file andrew.orig/overhead/snap2/pcserver/pcsprocs.c andrew/overhead/snap2/pcserver/pcsprocs.c *** andrew.orig/overhead/snap2/pcserver/pcsprocs.c Fri Jan 24 04:29:57 1992 --- andrew/overhead/snap2/pcserver/pcsprocs.c Sat Sep 4 11:16:01 1993 *************** *** 31,37 **** #include <sys/errno.h> #include <sys/param.h> #include <sys/stat.h> ! #ifdef M_UNIX #include <dirent.h> #define direct dirent #define namlen(d) (strlen((d)->d_name)) --- 31,37 ---- #include <sys/errno.h> #include <sys/param.h> #include <sys/stat.h> ! #if defined(M_UNIX) || defined(linux) #include <dirent.h> #define direct dirent #define namlen(d) (strlen((d)->d_name)) diff -cr --new-file andrew.orig/overhead/snap2/pcserver/pcsutils.c andrew/overhead/snap2/pcserver/pcsutils.c *** andrew.orig/overhead/snap2/pcserver/pcsutils.c Fri Jan 24 04:29:59 1992 --- andrew/overhead/snap2/pcserver/pcsutils.c Sat Sep 4 11:15:51 1993 *************** *** 26,32 **** #include <sys/errno.h> #include <sys/param.h> #include <sys/stat.h> ! #ifdef M_UNIX #include <dirent.h> #define direct dirent #define namlen(d) (strlen((d)->d_name)) --- 26,32 ---- #include <sys/errno.h> #include <sys/param.h> #include <sys/stat.h> ! #if defined(M_UNIX) || defined(linux) #include <dirent.h> #define direct dirent #define namlen(d) (strlen((d)->d_name)) diff -cr --new-file andrew.orig/overhead/util/lib/fselect.c andrew/overhead/util/lib/fselect.c *** andrew.orig/overhead/util/lib/fselect.c Fri Jan 24 04:31:14 1992 --- andrew/overhead/util/lib/fselect.c Sat Sep 4 12:06:51 1993 *************** *** 12,17 **** --- 12,26 ---- #include <stdio.h> #include <andrewos.h> /* sys/time.h */ + /* Useing internals of FILE * struct. */ + /* Yuck yuck yuck. This adds support */ + /* for the GNU streambuf FILE. */ + #if defined(linux) || defined(HAVE_STREAMBUF) + #define FILE_USED(f) ((f)->_egptr - (f)->_gptr) + #else + #define FILE_USED(f) ((f)->_cnt) + #endif + static int NOFILES; int fselect(nfds, rfiles, wfiles, xfiles, timeout) *************** *** 30,36 **** for (i = nfds; --i >= 0;) { register int fd; if (rfiles && rfiles[i] != NULL && (fd = fileno(rfiles[i])) >= 0 && fd < NOFILES) ! if (rfiles[i]->_cnt > 0) ret++; else rmask |= 1<<fd; --- 39,45 ---- for (i = nfds; --i >= 0;) { register int fd; if (rfiles && rfiles[i] != NULL && (fd = fileno(rfiles[i])) >= 0 && fd < NOFILES) ! if (FILE_USED(rfiles[i]) > 0) ret++; else rmask |= 1<<fd; *************** *** 43,49 **** ret = select(NOFILES, &rmask, &wmask, &xmask, timeout); else rmask = wmask = xmask = 0; for (i = nfds; --i >= 0;) { ! if (rfiles && rfiles[i] != NULL && rfiles[i]->_cnt <= 0 && (rmask & (1<<fileno(rfiles[i]))) == 0) rfiles[i] = NULL; if (wfiles && wfiles[i] != NULL && (wmask & (1<<fileno(wfiles[i]))) == 0) --- 52,58 ---- ret = select(NOFILES, &rmask, &wmask, &xmask, timeout); else rmask = wmask = xmask = 0; for (i = nfds; --i >= 0;) { ! if (rfiles && rfiles[i] != NULL && FILE_USED(rfiles[i]) <= 0 && (rmask & (1<<fileno(rfiles[i]))) == 0) rfiles[i] = NULL; if (wfiles && wfiles[i] != NULL && (wmask & (1<<fileno(wfiles[i]))) == 0) diff -cr --new-file andrew.orig/overhead/util/lib/pause.c andrew/overhead/util/lib/pause.c *** andrew.orig/overhead/util/lib/pause.c Fri Jan 24 04:31:28 1992 --- andrew/overhead/util/lib/pause.c Sat Sep 4 11:14:42 1993 *************** *** 35,41 **** #define RPAUSE_ENABLE 2 /* enable pause on error */ #define RPAUSE_ALL 0x7fffffff /* all error number types */ ! #if defined(AIX) || defined(M_UNIX) return 0; #else /* #ifdef AIX */ struct sigvec OldS, NewS; --- 35,41 ---- #define RPAUSE_ENABLE 2 /* enable pause on error */ #define RPAUSE_ALL 0x7fffffff /* all error number types */ ! #if defined(AIX) || defined(M_UNIX) || defined(linux) return 0; #else /* #ifdef AIX */ struct sigvec OldS, NewS; diff -cr --new-file andrew.orig/overhead/util/lib/t2open.c andrew/overhead/util/lib/t2open.c *** andrew.orig/overhead/util/lib/t2open.c Sun Apr 5 02:53:25 1992 --- andrew/overhead/util/lib/t2open.c Sat Sep 4 12:06:52 1993 *************** *** 53,59 **** /* This is child */ pid = getpid(); ! #if defined(hpux) || defined(SGI_4D_ENV) setpgrp(); #else /* hpux */ setpgrp(pid, pid); --- 53,59 ---- /* This is child */ pid = getpid(); ! #if defined(hpux) || defined(SGI_4D_ENV) || defined(linux) setpgrp(); #else /* hpux */ setpgrp(pid, pid); diff -cr --new-file andrew.orig/overhead/util/lib/times.c andrew/overhead/util/lib/times.c *** andrew.orig/overhead/util/lib/times.c Fri Jan 24 04:31:40 1992 --- andrew/overhead/util/lib/times.c Sat Sep 4 12:06:52 1993 *************** *** 11,17 **** #include <errno.h> #include <andrewos.h> ! #if (!defined(_IBMR2) && !SY_AIXx && !defined(HP300_ENV) && !defined(HP700_ENV) && !defined(HP800_ENV) && !defined(M_UNIX) && (!defined(SGI_4D_ENV)) && !defined(SUN_ENV)) extern char *timezone(); #endif /* (!defined(_IBMR2) && !SY_AIXx && !defined(HP300_ENV) && !defined(HP800_ENV)) */ --- 11,17 ---- #include <errno.h> #include <andrewos.h> ! #if (!defined(_IBMR2) && !SY_AIXx && !defined(HP300_ENV) && !defined(HP700_ENV) && !defined(HP800_ENV) && !defined(M_UNIX) && (!defined(SGI_4D_ENV)) && !defined(SUN_ENV)) && !defined(linux) extern char *timezone(); #endif /* (!defined(_IBMR2) && !SY_AIXx && !defined(HP300_ENV) && !defined(HP800_ENV)) */ *************** *** 67,76 **** --- 67,84 ---- gettimeofday(&TV, &TZ); osi_SecondsWest = (long) TZ.tz_minuteswest * 60; osi_IsEverDaylight = TZ.tz_dsttime; + #ifdef linux + strncpy(TZ0, tzname, sizeof(TZ0) - 1); + #else strncpy(TZ0, timezone(TZ.tz_minuteswest, 0), sizeof(TZ0) - 1); + #endif TZ0[sizeof(TZ0) - 1] = '\0'; osi_ZoneNames[0] = TZ0; + #ifdef linux + strncpy(TZ1, tzname, sizeof(TZ1) - 1); + #else strncpy(TZ1, timezone(TZ.tz_minuteswest, 1), sizeof(TZ1) - 1); + #endif TZ1[sizeof(TZ1) - 1] = '\0'; osi_ZoneNames[1] = TZ1; ZonesInitialized = 1; diff -cr --new-file andrew.orig/overhead/util/lib/topen.c andrew/overhead/util/lib/topen.c *** andrew.orig/overhead/util/lib/topen.c Fri Jan 24 04:31:43 1992 --- andrew/overhead/util/lib/topen.c Sat Sep 4 12:06:52 1993 *************** *** 58,64 **** /* myside and hisside reverse roles in child */ sigchild(); pid = getpid(); ! #if defined(hpux) || defined(SGI_4D_ENV) setpgrp(); #else /* hpux */ setpgrp(pid, pid); --- 58,64 ---- /* myside and hisside reverse roles in child */ sigchild(); pid = getpid(); ! #if defined(hpux) || defined(SGI_4D_ENV) ||defined(linux) setpgrp(); #else /* hpux */ setpgrp(pid, pid); diff -cr --new-file andrew.orig/overhead/util/lib/unscribe.c andrew/overhead/util/lib/unscribe.c *** andrew.orig/overhead/util/lib/unscribe.c Fri Jan 24 04:32:05 1992 --- andrew/overhead/util/lib/unscribe.c Sat Sep 4 12:06:54 1993 *************** *** 21,26 **** --- 21,30 ---- #include <util.h> #include <unscribe.h> + #ifdef linux + #include <bsd/bsd.h> /* grab a MIN definition. */ + #endif + /* #define SPECIALFACES 1 */ #define Version1 0 diff -cr --new-file andrew.orig/overhead/util/lib/usignal.c andrew/overhead/util/lib/usignal.c *** andrew.orig/overhead/util/lib/usignal.c Fri Jan 24 04:31:49 1992 --- andrew/overhead/util/lib/usignal.c Sat Sep 4 11:13:55 1993 *************** *** 22,28 **** { /* Returns a pointer to a static buffer containing English text describing the same signal condition that signalNumber describes (interpreted as a Unix signal number). The text has no newlines in it. We contend that this is what ``psignal'' should have been returning all along. */ static char SigBuff[40]; ! #if (!defined(hpux)) && (!defined(AIX) && !defined(M_UNIX)) extern char *sys_siglist[]; if (signalNumber < NSIG && signalNumber > 0) return sys_siglist[signalNumber]; --- 22,28 ---- { /* Returns a pointer to a static buffer containing English text describing the same signal condition that signalNumber describes (interpreted as a Unix signal number). The text has no newlines in it. We contend that this is what ``psignal'' should have been returning all along. */ static char SigBuff[40]; ! #if (!defined(hpux)) && (!defined(AIX) && !defined(M_UNIX)) && !defined(linux) extern char *sys_siglist[]; if (signalNumber < NSIG && signalNumber > 0) return sys_siglist[signalNumber]; diff -cr --new-file andrew.orig/xmkfontd/Imakefile andrew/xmkfontd/Imakefile *** andrew.orig/xmkfontd/Imakefile Fri Jan 24 03:38:52 1992 --- andrew/xmkfontd/Imakefile Wed Sep 8 22:49:44 1993 *************** *** 2,8 **** --- 2,11 ---- * Copyright IBM Corporation 1988,1991 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ + #define ISO80_FONTS_ENV + #undef NO_FONTS_ENV #ifndef NO_FONTS_ENV + #define RE #if SY_AIX221 install.time:: ${RM} ${DESTDIR}/X11fonts/fonts.alias *************** *** 11,22 **** ./aixrt.csh ${DESTDIR}/X11fonts .rtx #else /* SY_AIX221 */ #ifndef RELEASE2_ENV - install.time:: - ${RM} ${DESTDIR}/X11fonts/fonts.alias - ${XMKFONTDIR} $(DESTDIR)/X11fonts #ifdef ISO80_FONTS_ENV InstallFileToFile(non-andrew.fonts.alias, ${INSTLIBFLAGS}, ${DESTDIR}/X11fonts/fonts.alias) #else /* ISO80_FONTS_ENV */ #ifdef SCOunix #ifdef FONTS_TO_PCF_ENV ${CSHELL} ./mkfntdir.csh ${DESTDIR}/X11fonts .pcf --- 14,25 ---- ./aixrt.csh ${DESTDIR}/X11fonts .rtx #else /* SY_AIX221 */ #ifndef RELEASE2_ENV #ifdef ISO80_FONTS_ENV InstallFileToFile(non-andrew.fonts.alias, ${INSTLIBFLAGS}, ${DESTDIR}/X11fonts/fonts.alias) #else /* ISO80_FONTS_ENV */ + install.time:: + ${RM} ${DESTDIR}/X11fonts/fonts.alias + ${XMKFONTDIR} $(DESTDIR)/X11fonts #ifdef SCOunix #ifdef FONTS_TO_PCF_ENV ${CSHELL} ./mkfntdir.csh ${DESTDIR}/X11fonts .pcf